use strict; use warnings; for ('Joe Dolly', 'perl.pl', 'States', 'Fred Fillmore Flintstone') { my @got = split; if (scalar @got > 1) { print substr($_, 0, 1) for @got; print "\n"; } }