Syntactic Confectionery Delight | |
PerlMonks |
Re: Character Combinationsby esh (Pilgrim) |
on Aug 23, 2003 at 06:53 UTC ( [id://286020]=note: print w/replies, xml ) | Need Help?? |
if you just want the 3 letter combinations of the 26 lowercase letters in the English alphabet, this is pretty simple and probably very fast:
This would also work for uppercase, but as soon as you want to mix cases, add numbers, and add punctuation it falls short as a solution. The mechanism used here is the automagical increment operator (++) which does cool stuff when applied to a string starting with a letter and consisting of letters and numbers. Update: If you want to start with 1 character strings and go up to N characters, just change the initialization to: -- Eric Hammond
In Section
Seekers of Perl Wisdom
|
|