That's easy enough to accommodate:
sub fullname {
my @parts = @_;
for ( @parts ) {
s/(?<!\S)([A-Z])(?!\S)/$1./g;
}
return join " ", @parts;
}
Of course, given that sort of regex, I guess it doesn't matter whether you join the parts before or after the substitution. (It's using negative look-behind and negative look-ahead to check that a single upper-case letter is neither preceded nor following by a non-whitespace character, and in that case, put a period after the letter.) | [reply] [d/l] |