No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'd suggest breaking the string apart into individual letters (see split) and then using a hash table to track the letters. You can also use a hash table to track the words used, as well. See perlfaq4, sections "How can I remove duplicate elements from a list or array?" through "How can I test whether two arrays or hashes are equal?" for the basic method and examples. I don't recall whose signature line it is, but it's particularly appropriate: Figure out how to do the task by hand, and *then* write the program to do that. If you don't understand a technique but try to apply it, then my signature line becomes more appropriate. ;^P ...roboticus When your only tool is a hammer, all problems look like your thumb. In reply to Re^5: Need help with Peal!
by roboticus
|
|