in reply to Perl 'grammar'

The following assumes that the input names are formatted correctly. (If not you might want to look at the lc and ucfirst functions.)
use strict; my @fullnames = ("Smith, David", "Lamb, Mary", "Depp, Johnny", "Child, + Julia"); foreach my $fullname (@fullnames) { my ($last, $first) = map {s/^\s*//; $_} split /,/, $fullname; $first =~ s/^(\w).*/$1/; my $id = $first . $last; print "\$id = $id\n"; }
memnoch