Welcome to the Monastery | |
PerlMonks |
Re: Global variables in Perlby rovf (Priest) |
on Jun 04, 2010 at 09:43 UTC ( [id://843087]=note: print w/replies, xml ) | Need Help?? |
The reason why I do it is so I can turn on the debug switch by changing the value of the variable in one moduleWhich of course you could also do by using a lexical variable instead of a global one, plus providing a *function* which turns debugging on/off. The latter has the advantage that you could later hook in arbitrary actions to be executed when the debug state changes between on and off.
-- Ronald Fischer <ynnor@mm.st>
In Section
Seekers of Perl Wisdom
|
|