in reply to Re^4: Hard syntax error or disambiguable parsing?
in thread Hard syntax error or disambiguable parsing?
Cases 1, 3 and 4 are almost identical wrt the scoping rules applied to the loop variable. Case 1 differs to the others only in that the lexical variable $v doesn't exist before the perl compiler sees the loop (so I guess that $v will be allocated in that scope's scratchpad.)
Case 2 is the only different one wrt to scoping - depending on whether $v has been declared outside the scope in which the foreach occurs at all, or declared as my, or as our:
See also Re^6: Hard syntax error or disambiguable parsing?.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Hard syntax error or disambiguable parsing?
by ig (Vicar) on Jan 30, 2009 at 00:41 UTC | |
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 | |
by shmem (Chancellor) on Jan 30, 2009 at 13:59 UTC | |
by gone2015 (Deacon) on Jan 30, 2009 at 11:09 UTC |