NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
die() != exit() (Score:2)
Consider, for example,
print(). How often do you check the return value? But wouldn't you like to know if it didn't work in the middle of complex program? Exceptions allow the caller to program lazily (not checking return codes) and still get a wakeup call when something goes wrong.-sam
Reply to This
Re:die() != exit() (Score:1)
And note that
To amend my frustration, i've written a module a while ago called No::Die [cpan.org] which you might find useful in this context.
I use the same policy in CPANPLUS [cpan.org], since i do not want it to ever die.
Re:die() != exit() (Score:1)
Re:die() != exit() (Score:1)
substr will die on when used as an lvalue and the range is invalid.
use & require will die on failure.
Various other builtin functions will die if the Perl binary lacks the relevant support.