my@wordsInOrder; while (<>) { foreach ("$_" =~ m/\w+/g) { push @wordsInOrder, lc($_); } } #### my@wordsInOrder; while (<>) { push @wordsInOrder, lc() =~ m/\w+/g; }