Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Disable Perl warning

by davido (Archbishop)
on Nov 26, 2012 at 06:51 UTC ( #1005580=note: print w/ replies, xml ) Need Help??


in reply to Re: Disable Perl warning
in thread Disable Perl warning

The warnings pragma is lexical, and somehow it seems inelegant to wrap an entire file's code in an unless statement. Probably a cleaner approach would be the if pragma:

use if ! $MODE eq 'PRODUCTION', warnings;

Personally I think I would prefer figuring out why there are warnings being generated in the first place, fix those that need fixing, and for the rest...

{ no warnings 'warning type'; # Code that generated the useless warning here }

...but I do understand that there are times when enough thought has been put into it, nobody who understands the warning would see them anyway, and ultimately it's just time to silence them all and move on.


Dave


Comment on Re^2: Disable Perl warning
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-07-30 02:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls