Baby Names – Perl
No, We are not calling our Baby Perl!
Perl is the name of the programming language I used to write this script which took all the first names we were looking at, and all the second names, and made them into a real name, with initials. That way we can weed out all the name and initial combinations we don’t like.
I’m no great programmer, but I love a challenge. Here is the script I wrote, which works rather well, and even takes out duplicates. I’m sure it could be better, but I’ve never really written anything in perl before….(and it only took 20 minutes)
open(FIRST, first_name_list”) || die “”Could not open $filename…\n””::
foreach $fn (@first_name)
open(SECOND, “”second_name_list””) || die “”Could not open $filename…\n””::
foreach $sn (@second_name)
$fi = substr($fn, 0, 1)::
$si = substr($sn, 0, 1)::
if ($fn ne $sn)
print “”$fn $sn Snell $fi $si S\n””::
I got all my info from these two sites: www.spu.edu/help/tech/basic-perl/ & www.pageresource.com/cgirec/index2.htm