in reply to Re^3: Scope and references
in thread Scope and references
That was it!
I had always thought of the FOR loop as a single construct. I didn't realize that each time the control logic ($i++, etc.) is exectuted, you EXIT the brackets and lose that scope! But if you parse the code very precisely, that is literally what happens, so it now makes sense! Thank you BrowserUk!for (my $i=0; $i <=1; $i++) { #new scope in brkts }
|
|---|