If that's what is being passed to the funcion, then it would be much simpler to add periods as needed before joining the parts together:
sub fullname { my @parts = @_; for ( @parts ) { $_ .= '.' if ( /^[A-Z]$/ ); } return join " ", @parts; }
In reply to Re: simpler regex
by graff
in thread simpler regex
by rsiedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |