![]() |
|
go ahead... be a heretic | |
PerlMonks |
Re: Anagram Finderby mkmcconn (Chaplain) |
on Jan 09, 2001 at 18:23 UTC ( #50682=note: print w/replies, xml ) | Need Help?? |
That's pretty tidy, for sure. It will even work on a DOS command line. Maybe you'd be interested in shortening what follows? I worked an absurdly long time on it, trying to understand how hashes of arrays work. It borrows heavily from something by jcwren and from the Cookbook:
This doesn't filter out non-alpha stuff, but it does eliminate duplicates. It's not quite as flexible as yours, either, but it does take words from STDIN ( - it's too long for in Windows, but it can be shortened - I'd leave in strict, though. There's funny stuff going on here that could cause unpredict- able results if the wrong thing is put on the command-line). It will also take a redirect from any file (not just lists). So, it could be used as "perl -e '..etc...' < ${pathto}/wirds to find anagram in that dictionary (yeesh). No globbing. Or, it can be invoked as "perl -e '..etc..'__Type Words__
followed by CTRL-D to exit.
In Section
Snippets Section
|
|