Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: use of "use X"

by JavaFan (Canon)
on Jan 18, 2012 at 10:07 UTC ( [id://948517]=note: print w/replies, xml ) Need Help??


in reply to use of "use X"

BEGIN { my $debug = 0; unless ($debug) { $INC {"warnings.pm"} = 1; no strict 'refs'; *{"warnings::import"} = sub {1;}; } } use warnings;
Of course, that will prohibit warnings to be turned on from anywhere in your program.

If you can live with just one category enabled if debugging is off, you could do:

BEGIN { $::DEBUG = 1; } use warnings $::DEBUG ? "all" : "io"; # Or some other category.

Log In?
Username:
Password:

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

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

    No recent polls found