Any way to catch a die message? I want to catch a die message from a sub
routine, log it, and continue with a different sub routine.
Hello.You could redefined the SIGDIE handler,point it to the reference of a
subroutine (or an anonymous subroutine).In this subroutine,you could do the
things you like,for example,writting logs or other.
$SIG{__DIE__}=\&log_die;
sub log_die
{
write_log(@_);
do_other_things();
die @_;
}
Now when your program meet the 'die',the subroutine (log_die) shoud be
called,some actions should be executed before the final die.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>