Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Turn off warnings, diagnostics?

by davido (Archbishop)
on Nov 07, 2012 at 17:52 UTC ( #1002701=note: print w/replies, xml ) Need Help??

in reply to Turn off warnings, diagnostics?

I want the warnings. I just want to make sure they're directed somewhere useful, such as a log file.

In my opinion, tests should exercise the code to the degree that your own carp, croak, cluck, confess, die, and warn statements are executed. Tests should also check that there aren't any Perl-generated warnings and un-caught exceptions (deaths). In a real world the tests you write probably won't anticipate every possible way that a script might generate a warning. Those warnings (and even fatals) it does generate should be logged so that the maintainer can investigate and take corrective action.

Silencing all warnings so that they bother nobody might prevent the maintainer from even knowing there's an issue, and possibly a serious issue, that happens to only turn up out in the real world (ie, production). When I ship code I intend to also be the one maintaining it, and I want to have the ability to quickly ascertain there are no problems that I didn't anticipate. I wouldn't be as effective if I took the "bury my head in the sand" approach.

Diagnostics, on the other hand, have no place in production code. The warning itself is plenty, because in the event I am unfamiliar with a given warning I can always just dive into perldiag to read what it means.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002701]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2018-06-25 04:30 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.