Keep It Simple, Stupid | |
PerlMonks |
Re^3: "When closures capture their context" and "scope gotchas in Javascript"by Errto (Vicar) |
on Feb 08, 2008 at 18:49 UTC ( [id://667038]=note: print w/replies, xml ) | Need Help?? |
I intended to learn Lua, until I found out that variables are global by default, and you have to add a keyword to limit their scope to the current sub/method.That's true in Perl too if you don't use strict. Well, so in Perl the alternative is lexical scope which, as I know from certain other *ahem*VB*ahem* experience, is much better than subroutine scope for most purposes.
In Section
Meditations
|
|