Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: for loops

by hossman (Prior)
on Oct 11, 2004 at 01:09 UTC ( [id://398067]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://398067]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-18 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found