in reply to Re: Tying events to perl warnings and errors
in thread Tying events to perl warnings and errors

Playing with $SIG{__WARN__} and $SIG{__DIE__} is fun, but remember that you can't out-wit death. If die gets called, the script will end, but first it will evaluate/run the expression/subroutine that is $SIG{__DIE__}. It will pass die's arguments in as @_ and will disable the signal (avoiding recursive calls to $SIG{__DIE__}). Good stuff really. Great if you want to say... print a time stamp whenever your script dies... or log warnings to an extra log file. (you trigger __WARN__ when you call warn too.)
  • Comment on RE: Re: Tying events to perl warnings and errors

Replies are listed 'Best First'.
RE: RE: Re: Tying events to perl warnings and errors
by merlyn (Sage) on Sep 13, 2000 at 23:45 UTC
      Thanks.