in reply to How do I create a list with the 10 most frequently used words in a file?

foreach my $word (sort keys %count) { printf "%-31s %s\n", $word, $count{$word}; }

The only thing is, is that this program shows the frequency of every word in the appeared order of the text file. What would I need to add, to be able to not only get the before mentioned result but also listing the ten most commonly used words in descending order?

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)