Subject: | Documentation for 'parse' return values doesn't match the code |
Below is a doc-patch to bring the documented return values for 'parse'
into line with the actual code.
diff --git a/lib/Lingua/EN/NameParse.pm b/lib/Lingua/EN/NameParse.pm
index 30a22cb..b45fb9b 100755
--- a/lib/Lingua/EN/NameParse.pm
+++ b/lib/Lingua/EN/NameParse.pm
@@ -22,7 +22,7 @@ Lingua::EN::NameParse - routines for manipulating a
person's name
my $name = new Lingua::EN::NameParse(%args);
- $error = $name->parse("MR AC DE SILVA");
+ ($name, $error) = $name->parse("MR AC DE SILVA");
%name_comps = $name->components;
$surname = $name_comps{surname_1}; # DE SILVA
@@ -262,13 +262,13 @@ are ignored. Disabling extended titles speeds up
the processing.
=head2 parse
- $error = $name->parse("MR AC DE SILVA");
+ ($name, $error) = $name->parse("MR AC DE SILVA");
The C<parse> method takes a single parameter of a text string containing a
name. It attempts to parse the name and break it down into the components
-described above. If the name was parsed successfully, a 0 is returned,
-otherwise a 1. This step is a prerequisite for the following functions.
-
+described above. If the name was not parsed successfully
C<$name->error> will
+true. Returns the object and the value of C<$name->error>. This step is a
+prerequisite for the following functions.
=head2 case_all