in reply to Chaining/Stacking $SIG{__WARN__}

my $oldhandler = $SIG{SOMETHING}; $SIG{SOMETHING} = sub { # do whatever if ($oldhandler) { $oldhandler->(); } };
Notes:

1. this assumes that the other code does something like this as well, or that your handler is installed after the old one. See for instance my pretty simple CGI::HTMLError.

2. some kinds of signals (like SIGCHLD) are more complicated than this and may need special care.

Replies are listed 'Best First'.
Re^2: Chaining/Stacking $SIG{__WARN__}
by Anonymous Monk on Mar 07, 2008 at 13:04 UTC
    I'd like to thank both of you for responding.