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

Re: Global variables in Perl

by rovf (Priest)
on Jun 04, 2010 at 09:43 UTC ( [id://843087]=note: print w/replies, xml ) Need Help??


in reply to Global variables in Perl

The reason why I do it is so I can turn on the debug switch by changing the value of the variable in one module
Which 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>

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-23 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found