Perl Monk, Perl Meditation | |
PerlMonks |
RE: for loopsby nop (Hermit) |
on Nov 01, 2000 at 21:28 UTC ( [id://39438]=note: print w/replies, xml ) | Need Help?? |
When using multiple initializations in a for loop,
I found that scoping didn't work as I expected it would.
For example, in this fake snippet
the line generates an error because $i doesn't exist yet. Not a big deal, and trivial to work-around, but can someone explain why scoping works this way here? nop
In Section
Tutorials
|
|