Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Are global variables "bad"?

by gwadej (Chaplain)
on Apr 22, 2009 at 16:55 UTC ( [id://759342]=note: print w/replies, xml ) Need Help??


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

Perhaps a better way to say it is not that globals are bad, but that globals are easy to use badly.

I often find that I am suspicious when I run across global variables (and now Singletons) in code that is larger than a single script. I know (from much painful experience) that the globals are likely to be the focus of surprising behavior from changes due to unrelated code.

Personally, I learned this not from any CS classes, but from being bitten a few times too many.

G. Wade

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-03-28 17:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found