|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: variables from STDINby derby (Monsignor) |
| on Feb 22, 2012 at 13:35 UTC ( #955528=note: print w/ replies, xml ) | Need Help?? |
|
Interesting ... if I'm reading the OP correctly, you want to create a looping structure that is influenced in two ways by a command line argument: first, the number of loops is controlled by the length of the command line argument; and two, what you're looping is controlled by the command line argument. So if the command line argument is CV, you loop as such: and if the command line argument is CVCCVC, you loop as such: is that correct? My first reaction is find another way. But if you wish to persist, I think recursion is your frenemy here:
I say frenemy because the above is a fairly naive implementation and eventually some combination of template size and/or arrays is going to blow the stack.
-derby
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||