Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Perl Monk, Perl Meditation
 
PerlMonks  

Re: when to use die, questions about program feedback to the coder

by cbrandtbuffalo (Deacon)
on Mar 09, 2006 at 12:55 UTC ( [id://535452]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to when to use die, questions about program feedback to the coder

If you are going down this road, consider Carp::croak and Carp::confess as well. They give a lot more info on the calling context when they fire and can make it much easier to track down where the error came from.

If you do convert to throwing exceptions for errors, you can use evals in your calling code to control whether the exceptions will actually kill your program.

There is a nice chapter in Damian's Perl Best Practices book on error handling too.

  • Comment on Re: when to use die, questions about program feedback to the coder

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://535452]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.