Skip Menu |

This queue is for tickets about the Lingua-EN-NameParse CPAN distribution.

Report information
The Basics
Id: 46970
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: Lingua-EN-NameParse

People
Owner: kimryan [...] cpan.org
Requestors: cpan [...] prather.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.24
Fixed in: (no value)



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
Fixed in 1.27. Changed the parse method to match the documentation. It was returning a name object and an error flag, when only the flag was required. Note that this caused no problem if used as documented, the error value was still assigned correctly, and the name object assigned to nothing.