laziness, impatience, and hubris | |
PerlMonks |
Re: my() and our()by revdiablo (Prior) |
on Aug 09, 2005 at 15:49 UTC ( [id://482267]=note: print w/replies, xml ) | Need Help?? |
If our() has the same scoping rules as my() The scoping rules are only the same in terms of where the variable is accessible. Meaning you can only access a lexical variable within the current lexical scope. Outside of that, you will get an error (if you're using strict). The rules aren't the same when it comes to how long the variables live, as you've discovered.
In Section
Seekers of Perl Wisdom
|
|