I have a couple of suggestions that I hope will be helpful.
s/\W//g, push @{$dict{join "", sort split //, lc}}, $_ for <DICT>;
In other words, sort each word and store it in its canonical form in the lookup table, so all anagrams are stored together. Then, when you want to check for anagrams of a word, you just go straight to its canonical key in the hash.
This might make your starts_word slower/less clear, but I'm not sure. Of course, starts_word won't be necessary for anagram lookups anymore, but it would be a useful standalone function.
-dlc
In reply to Re: Module Submission for CPAN
by dchetlin
in thread Module Submission for CPAN
by tedv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |