If you get an exception because you misused the API of a module, you usually want to know where in your the error is, so you're happier when the module called croak().
Of course that concept breaks down when you write a module that uses another module which uses croak() -- the errors will come from your module, not from your module user's code.
In the case of internal errors, modules should use die, or maybe even Carp::confess.
(Oh, and if (as a user) you want to get a backtrace no matter what, use Carp::Always).
In reply to Re: die or croak
by moritz
in thread die or croak
by McA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |