Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: "When closures capture their context" and "scope gotchas in Javascript"

by Errto (Vicar)
on Feb 08, 2008 at 18:49 UTC ( #667038=note: print w/replies, xml ) Need Help??


in reply to Re^2: "When closures capture their context" and "scope gotchas in Javascript"
in thread "When closures capture their context" and "scope gotchas in Javascript"

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.
  • Comment on Re^3: "When closures capture their context" and "scope gotchas in Javascript"
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://667038]
help
Chatterbox?
[Corion]: :-D
[RonW]: My daughter and I like to "fly" Flightgear. What ever aircraft we pick, she usually shoots me out of the sky
[Corion]: Oooh. I didn't know about Flightgear. I've been looking at maybe playing with a flight simulator again, thanks!

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-02-27 18:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (390 votes). Check out past polls.