in reply to RE: for loops
in thread for loops
can someone explain why scoping works this way here?
That question implies that the scoping works differently elsewhere -- it doesn't. you get that error regardless of the for loop...
laptop:~> perl -Mstrict -e 'my $i=1, my $j=$i+1; print $i + $j;' Global symbol "$i" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors.
...the behavior of the comma oporator is not changed by being used in a for loop.
|
|---|