$freq_count{$_}++ for get_words(<>); # Takes one or more strings, returns all words it finds. sub get_words { map /(\w+(?:'[ts])?)/g, @_; }