Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: for loops

by hossman (Prior)
on Oct 11, 2004 at 01:09 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2020-05-29 01:25 GMT
Find Nodes?
    Voting Booth?
    If programming languages were movie genres, Perl would be:

    Results (166 votes). Check out past polls.