go ahead... be a heretic | |
PerlMonks |
Re^2: do, local and a qualified identifier?by pg (Canon) |
on Oct 09, 2005 at 03:22 UTC ( [id://498500]=note: print w/replies, xml ) | Need Help?? |
The last part of your post might misled people to think that our is a must for removing the syntax error. So just a little bit more detail... Remove the package qualifier, but keep local, it results syntax error:
But use either my or our removes the error:
But the use of our or my does make difference in other sense. The following script works when $bar is defined with our:
But does not work if $bar is defined with my:
my or our? depends on what you want to do - in what scope you want your variables to be seen.
In Section
Seekers of Perl Wisdom
|
|