The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Lingua::Names - test a string to see if it is a first name


   use Lingua::Names 'is_name';

   for my $string (qw/leo james jawf 44 lUCy/){

      printf "is name '$string'? %s\n",
               ? 'yes' 
               : 'no' 


I wanted to test strings to see if the looked like names, first names. There seemed not to be anything out there. After discussion on perlmonks.. Here it is.

This module is very basic. It only tests against a selection of names from a United States census. As of this version: Total female names: 3944 Male names: 1219 Total: 5163


None are exported by default.


Argument is string. Returns true or false. Truth is returned as the value passed.

Useful for something like :

   my $name = is_name($arg)
      or warn("Not name.")
      and next;


In development, alpha. Please contact AUTHOR with any suggestions, crit, complaints, etc.. AUTHOR is very open to peer review.


Peter Hickman's Data::RandomPerson, most of the names are taken from here. Sadly, you can't ask those modules for a list.


"skim" - helped with documentation.


Leo Charre leocharre at cpan dot org


This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e., under the terms of the "Artistic License" or the "GNU General Public License".


This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the "GNU General Public License" for more details.