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

Re: Best practices for handling exceptions in die/eval style

by TheloniusMonk (Sexton)
on Aug 30, 2018 at 08:32 UTC ( [id://1221354]=note: print w/replies, xml ) Need Help??


in reply to Best practices for handling exceptions in die/eval style

The only reason to prevent something dying is where its maintenance is, at least temporarily, beyond your control. So IMO best practice is, yes, patch around it with one of the techniques already mentioned, but I'd avoid too routine a habit of patch and forget - be sure to have bug-reporting/follow-up built in to your dev cycle.

In regard to warnings, they should be corrected. If a CPAN module produces a warning and it is a result of giving it duff parameters, I'd be inclined to force it to die and fix the root cause in my code. 'use strictures 2;' is a shorthand for the following:-

use strict; use warnings FATAL => 'all'; use warnings NONFATAL => qw( exec recursion internal malloc newline experimental deprecated portable );
which is not necessarily the best match for either your code or a given CPAN module. So it is worth maintaining a site policy on these settings.

Finally, if you are convinced a warning is wrong, best post it here for discussion.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-28 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found