in reply to Re^6: 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?
You don't, and that's a good thing. (You mean "foreach loop" there, I presume.)
  • Comment on Re^7: Hard syntax error or disambiguable parsing?

Replies are listed 'Best First'.
Re^8: Hard syntax error or disambiguable parsing?
by NateTut (Deacon) on Feb 16, 2009 at 16:52 UTC
    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...
        I think I misunderstood the issue. I tried to build a test script to illustrate but it didn't work as I expected (I was able to do what I said I couldn't earlier).

        When I ran into what I thought was this problem in the past it must have been something else.

        Sorry.