in reply to for loops
the lineuse strict; ### this code contains an error for (my $i=1, my $j = $i + 100; $i<50; $i++, $j++) { print "i=$i j=$j hello!\n"; }
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? nopmy $j = $i + 100;
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: RE: for loops
by mirey (Initiate) on Nov 02, 2000 at 04:51 UTC | |
Re^2: for loops
by hossman (Prior) on Oct 11, 2004 at 01:09 UTC | |
Re^2: for loops
by apotheon (Deacon) on Oct 11, 2004 at 00:58 UTC |