for my $line (@lines) { my @tmp=split ' ', $line; push @words, $tmp[0]; } #### push @words, (split)[0] for @lines; #### @words=map +(split)[0], @lines; #### use strict; # along with use warnings; #### my @array = ();