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