![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Re: usage of "my" keywordby taint (Chaplain) |
on May 10, 2016 at 17:17 UTC ( #1162651=note: print w/replies, xml ) | Need Help?? |
OK. While at this point, it will seem quite obvious. I'm going to list it, for completeness. As I would have thought it the first thing to show up. :)
Here cant i declare a variabe without using my keyword. Error: Global symbol "$i" requires explicit package name at for.pl line 6.Technically, you can OR, clobber them all up front: OK those were pretty much directly from the strictures documentation (which is why I felt they should have been included here). But why not illustrate another possibility -- global Variable Scoping in Perl: the basics? Cool, huh? Well, not really. While the PHP language practically encourages global variables. In most cases, it should be avoided. If for no other reason; security reasons. Ovid has written a nice overview, that outlines global variables scoping, titled: 'our' is not 'my', that better describes this. There. Now this feels complete :) --Chris ¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH
In Section
Seekers of Perl Wisdom
|
|