Perl: the Markov chain saw | |
PerlMonks |
Re^4: Generate sequential array element combos (.. and ++)by tye (Sage) |
on Jul 28, 2004 at 05:37 UTC ( [id://377929]=note: print w/replies, xml ) | Need Help?? |
For that case you can get as simple as
but that chews up quite a chunk of memory. You can use tons less memory with something like
But, of course, that won't help much if you hope to change your list of characters to something other than 0..9. Algorithm::Loops would probably be quite helpful for this if you do hope to use characters other than digits. But I think I'll not code an example for that at this point, though it can be done fairly simply (or more complexly if you want a single iterator, for example). - tye
In Section
Seekers of Perl Wisdom
|
|