in reply to Frequency of words in text file and hashes

Once you have the words splitted in an array, you can grab all the information from the hash. I.e.:
my $total_words = @words; #All word count my %count; $count{$_}++ for @words; # Here are the counts my $uniq_words = scalar keys %count; # Nš of uniq words # Print sorted by frequency print "$_\t$count{$_}" for (sort { $count{$b} <=> $count{$a} } keys %c +ount);

Hope it helps,
deibyz