Keep It Simple, Stupid | |
PerlMonks |
Re: Variable in a foreach loopby shadowsong (Pilgrim) |
on Jul 15, 2016 at 11:12 UTC ( [id://1167829]=note: print w/replies, xml ) | Need Help?? |
Hi ravi45722 Just to set you straight - that's what it's supposed to do... There's a very subtle difference between declaring your iterator inside and outside the loop.
My advice would be rename your iterator variables to avoid confusion with lexicals outside your loops... Cheers,
In Section
Seekers of Perl Wisdom
|
|