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