in reply to Word Frequency counter

You've used literal barewords "a" and "b" as hash keys in your sort comparitor where you wanted to be using the variables $a and $b.

The cake is a lie.
The cake is a lie.
The cake is a lie.