Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Are global variables "bad"?by jettero (Monsignor) |
on Apr 21, 2009 at 16:39 UTC ( [id://759052]=note: print w/replies, xml ) | Need Help?? |
Globals are a pretty common thing in modules. There's a lot of really good reasons to use package globals and package namespace globals. If your script is just a collection of functions, then they're acting a bit like a module called "main." On one extreme, you end up passing the same (essentially) global data from function to function, just to avoid a global variable ... on the other extreme, every variable in the program is global. Extremes can be bad. Global variables aren't necessarily bad. -Paul
In Section
Seekers of Perl Wisdom
|
|