in reply to How can two modules latch onto $SIN{__WARN__} or $SIG{__DIE__}?
If they catch the fact that you are in the call stack you might want to leave the goto in, but then you are limiting them to one warning in the entire script.if ($SIG{__WARN__}) { my $previous = $SIG{__WARN__}; my $caught = 0; $SIG{__WARN__} = sub { return if $caught; $caught = 1; # do my stuff my $ret = $previous->(); $caught = 0; return $ret; }; } else
UPDATE
Oops. I forgot to call the ref. :-(
Worse than that, the solution is too complex and misses the cause of the problem. See the response I have down below. Just drop the goto and the original code works.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: How can two modules latch onto $SIN{__WARN__} or $SIG{__DIE__}?
by rrwo (Friar) on Jan 10, 2001 at 08:08 UTC | |
by tilly (Archbishop) on Jan 10, 2001 at 08:19 UTC |