more useful options | |
PerlMonks |
Re: C-style for loopby LanX (Saint) |
on Nov 15, 2008 at 19:48 UTC ( [id://723838]=note: print w/replies, xml ) | Need Help?? |
"c-style" is just the name of the loop, it depends what you need...TIMTOWTDI! (*)
Anyway, with foreach-loop you shouldn't need a new array, since the iterating variable is an alias.
(*)UPDATE: in many cases foreach-loops are easier to maintain and less redundant than c-style. If you explicitly need to generate a *new* array, prefere map or grep. Cheers LanX - - - - - Which song???
In Section
Seekers of Perl Wisdom
|
|