[ Duplicate post. Please ignore ]
Use a trie instead of a hash table.
For future reference,
if(exists $wordCount{$_}) { $wordCount{$_} = $wordCount{$_} + 1; } else { $wordCount{$_} = 1; }
can be shortened to
++$wordCount{$_};
It won't help your memory problem, just your code clarity.
In reply to [DUP] Re: Out of Memory
by ikegami
in thread Out of Memory
by instinct_4ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |