in reply to Splitting/joining on different characters

To answer your second question, just normalize the input first. s/,(?=\S)/, /;

Your first question ... I'd rewrite it as so:

foreach my $name ( @names ) { my @n; foreach ( split ' ', $name ) { # Go through each item, push'ing onto @n } $name = join ' ', @n; }
At that point, @names has been modified in-place using aliasing.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?