good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^4: Using an array element as a loop iteratorby gurpreetsingh13 (Scribe) |
on Nov 08, 2013 at 15:17 UTC ( [id://1061724]=note: print w/replies, xml ) | Need Help?? |
Thanks. That is nice
But what I actually wanted to achieve was that I had several nested foreach loops and taking several variables, one for each iterator, is nearly horrible. I wanted to initialize one array and then use that as a container for all the iterators of nested arrays. This step $a[1]=$_or something similar will do that, but still that statement needs to be put as first step in loops of all 20 nested arrays. Isn't there any way through which we can avoid that and achieve the result via the foreach step only like something --
And not using something like-- </code>
In Section
Seekers of Perl Wisdom
|
|