in reply to Using $_ in nested loops
Calling local on a list of variables modifies the values of those variables to be "local" to the current block, and to any subroutines called from within that block. It does this by saving the value of the variable before you called local, then restoring the value after the block has ended (or some variation on this; it may be more complex. :)> And if variable scoping would solve my percieved problem, > understand that the issue of my vs. local is something I > don't grok yet. I completely understand my, but local > escapes me.
Take a look at perlsub (Temporary Values via local()) for a better explanation.
You also wrote:
Sure: what you did isn't illegal by any means, and in some circumstances, it's probably exactly what you want.> The odd thing is that I ran something like this, with > -w and use strict;, and it worked! Why? Should it have > worked?
|
|---|