Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^6: Hard syntax error or disambiguable parsing?

by NateTut (Deacon)
on Feb 13, 2009 at 21:26 UTC ( [id://743713]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Hard syntax error or disambiguable parsing?
in thread Hard syntax error or disambiguable parsing?

How could I get the for loop to use the predeclared $i instead of using a local one?

Replies are listed 'Best First'.
Re^7: Hard syntax error or disambiguable parsing?
by merlyn (Sage) on Feb 13, 2009 at 21:54 UTC
    How could I get the for loop to use the predeclared $i instead of using a local one?
    You don't, and that's a good thing. (You mean "foreach loop" there, I presume.)
      Well I have run into occasions where I would like use a previously declared variable as the loop variable in a situation like this. I know I can always just set a predeclared variable to be equal to the local loop variable, but that seems messier to me. Don't get me wrong I really like the local loop variable feature I would just like to "turn it off" occasionally. I probably don't understand some basic concept here most likely...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2024-04-19 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found