push @{$Word{length$_}},$_ while (<>); #### $len = length($_); #let's say $len is 5 $hash{$len}=[] unless defined $hash{$len}; # make a hash key called "5" with an empty array as the value push($hash{$len},$_); #use it as an array and push this five-letter word onto it. #### ($_='jjjuuusssttt annootthhrer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;