http://qs1969.pair.com?node_id=517241


in reply to Creating Dictionaries

Try this instead ...
use strict; use warnings; my %hash; while (my $line=<STDIN>){ foreach my $word ( split( /[^a-zA-Z]+/ , $line) ){ my $len = length($word); $hash{lc $word}++ if 2<=$len && $len < 5; } } print $_."\n" for sort keys %hash;
comments/explanations: