|go ahead... be a heretic|
Character Combinationsby viGuy (Initiate)
|on Aug 22, 2003 at 21:46 UTC||Need Help??|
viGuy has asked for the wisdom of the Perl Monks concerning the following question:
First off - if you feel the question is un-ethical - fair enough - I am inclined to agree, but this is still an interesting question to which perl I belive is ideally suited - so, disclaimer aside, here is what I would like to achieve:
What would be the most efficient way to produce every possible combination of a given set of charactors in a string?
Here are my thoughts so far:
Using hashes - I belive these to be more efficient than arrays - one hash assigned to each charactor in the string. The hash would contain the possible charactor values with incremental numbers for the key values.
Now you know and I know how this could be applied - but there are plenty of "off the site" products out there that I could use to achieve the same thing. This is more for 'fun' to figure out how to do this EFFICIENTLY in perl. So - what do you think? How would you approach this?
20030823 Edit by jeffa: Changed title from 'Charactor Combinations '