in reply to Anagram finder
Hint: Take a look at Mastering Perl Algorithms.open DICT, "</usr/dict/words" or die "no more words: $!"; $a = join "", sort split "", lc shift; for(<DICT>){ $b = lc($_); chomp($b); $b = join("",sort(split //,$b)); if($a eq $b){print} }
This way, the contents of dictionary aren't loaded into an
array, advisable if you're playing on anything
smaller than an Enterprise Server.
I like the concise style of code though ;0).
--Brother Frankus.
|
|---|