Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: is it possible to make perl die on error automatically?

by davido (Cardinal)
on Aug 02, 2011 at 17:20 UTC ( #918106=note: print w/replies, xml ) Need Help??

in reply to is it possible to make perl die on error automatically?

  • autodie for IO operations.
  • RaiseError with DBI.
  • XML::Parser: A die call is thrown if a parse error occurs.
  • XML::LibXML will throw an exception if a parsing error occurs.
  • warnings can be elevated to fatals. See perllexwarn.
  • strict will make some risky behaviors an error that won't allow execution to begin.
  • perlrun: Taint mode will throw an exception if it catches you doing unsafe things with tainted input.
  • You can, of course, pepper your code with or die $! or or die "Message..."

There are plenty of other possibilities too, if we knew what you're after.


Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2023-12-09 21:38 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (38 votes). Check out past polls.