http://www.perlmonks.org?node_id=993296


in reply to Simple Keyword Generator

One really minor thing I'd do differently: Rather than split on whitespace and then check length, just match 3 or more non-whitespace characters:

#foreach my $word (split /\s+/, $line) { # length($word) > 2 and $count_of{$word}++; #} $count_of{$_}++ for $line =~ /\S{3,}/g;