in reply to Using $_ in nested loops
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
|
|---|