in reply to Re^5: Hard syntax error or disambiguable parsing?
in thread Hard syntax error or disambiguable parsing?
if it has been declared with my, the loop variable will be aliasing that $v, and lexically scoped
What, exactly, does 'aliasing that $v' mean?
I expect it means the same thing as 'it uses that variable instead of the global one' in the following extract from perlsyn, but I don't know what that means either.
If the variable was previously declared with my, it uses that variable instead of the global one, but it's still localized to the loop.
I thought I knew what it meant but the examples here prove that my (mis-)understanding was wrong. What is the significance of it using that variable? When does it make a difference?
Based on the examples here, it seems as if perlsyn could (maybe should) be rewritten to say:
If the variable was previously declared with my then the variable is implicitly lexically scoped, and is therefore visible only within the loop.
Does this make sense? Is it correct? Or am I still ignorant and confused?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Hard syntax error or disambiguable parsing?
by BrowserUk (Patriarch) on Jan 30, 2009 at 02:54 UTC | |
by rovf (Priest) on Jan 30, 2009 at 08:52 UTC | |
by BrowserUk (Patriarch) on Jan 30, 2009 at 09:19 UTC | |
by shmem (Chancellor) on Jan 30, 2009 at 14:21 UTC | |
|
Re^7: Hard syntax error or disambiguable parsing?
by shmem (Chancellor) on Jan 30, 2009 at 13:59 UTC | |
|
Re^7: Hard syntax error or disambiguable parsing?
by gone2015 (Deacon) on Jan 30, 2009 at 11:09 UTC |