The odd thing is that I ran something like this, with -w and use strict;, and it worked! Why? Should it have worked?Yes, and thank goodness it does. I never think about outer variables when coding the foreach loop, thanks to the automatic localization. And as you've discovered, the localization of the control variable happens after the list has been computed. Yes! thank you larry!
-- Randal L. Schwartz, Perl hacker
In reply to Re: Using $_ in nested loops
by merlyn
in thread Using $_ in nested loops
by t'mo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |