Keep It Simple, Stupid | |
PerlMonks |
Re: my() and our()by xdg (Monsignor) |
on Aug 09, 2005 at 18:48 UTC ( [id://482367]=note: print w/replies, xml ) | Need Help?? |
And if the othe various posts haven't illuminated yet, it's worth walking through some other examples step by step. (Including strict and warnings.) Using all fully qualified globals:
Declaring within the block:
Declaring within the block and trying to use unqualified later (on line 9) causes a compile-time error under strict -- the "our" only has its effect of allowing use of the variable name without fully qualifiying it while within the block:
Typical usage "at the top" applies to the whole file:
-xdg Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In Section
Seekers of Perl Wisdom
|
|