in reply to Handling caps for surnames with capitals in the middle (was: Irish Surnames)

First build a list (i ain't smart), then use it
my @List = qw/ Mac Mc De /; my @NAMES = map ucfirst, qw/ mcginley macgee develera/; for my $name (@NAMES) { for my $match( grep {$name =~/^$_/} @List ) { warn $name; $name =~ s/^\Q$match\E(.*)$/$match.ucfirst($1)/e; warn $name; } }
The output from the above code I get is
Mcginley at - line 6.
McGinley at - line 8.
Macgee at - line 6.
MacGee at - line 8.
Develera at - line 6.
DeVelera at - line 8.
  • Comment on Re: Handling caps for surnames with capitals in the middle (was: Irish Surnames)
  • Download Code