Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: Are global variables "bad"?

by JavaFan (Canon)
on Apr 21, 2009 at 21:21 UTC ( [id://759121]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Are global variables "bad"?
in thread Are global variables "bad"?

local only works on global variables.
Not true. It's not even true if you meant "package" where you wrote "global".
$ perl -wE 'my @a = (1, 2, 3); {local $a[1] = 7; say "@a";} say "@a"' 1 7 3 1 2 3

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://759121]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found