Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

local variables in Perl and Lua

Name: Anonymous 2011-07-22 21:32

I didnt get an answer for this in the Python thread, so I'll ask here: Why do variables have to have the local keyword to make their scope local? Why cant it just use implicit lexical scope like most any other languages?

Name: Anonymous 2011-07-23 3:33

>>16
local in Perl is unfortunately named. You want the Huffmanized my.
my just does what local should, make variables lexically scoped
You also want use strict
all strict does is force you to use my

which still doesnt answer the question, why cant lexical scope be default instead of having to put my in front of all variables

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List