Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Are There Error Handlers in Perl?by repson (Chaplain) |
on Jan 20, 2001 at 09:34 UTC ( [id://53170]=note: print w/replies, xml ) | Need Help?? |
People are saying that $SIG{__DIE__} is a bad thing. This
is true if die is just used with strings.
However this document at perl.apache.org, despite being written for mod_perl, gives good instructions for the procedure of dieing with objects. This allows you to do this sort of thing: die My::Exception->SomeException( foo => "bar" ); And then deal with the data SomeException and (foo => 'bar') in the exception class My::Exception. Or you can overload the die function, allowing other trickery.
In Section
Seekers of Perl Wisdom
|
|