http://qs321.pair.com?node_id=427667


in reply to Implementing the counterpart of BEGIN

You are looking for perldoc sigtrap I suppose.

  • Comment on Re: Implementing the counterpart of BEGIN

Replies are listed 'Best First'.
Re^2: Implementing the counterpart of BEGIN
by punkish (Priest) on Feb 03, 2005 at 15:41 UTC
    use sigtrap 'handler', \&my_handler, 'normal-signals'; sub my_handler { open(STDERR, ">>test.err") or die "invisible error"; warn "die-ing at " . localtime() . " because of: $!\n"; }

    does the job. Many thanks for your quick help.