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.
In reply to Re: Global variables in Perl
by rovf
in thread Global variables in Perl
by taioba
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |