Are they trying to rethrow the die? And then you catch it again. Try this:
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
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.

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.


In reply to Re (tilly) 1: How can two modules latch onto $SIN{__WARN__} or $SIG{__DIE__}? by tilly
in thread How can two modules latch onto $SIN{__WARN__} or $SIG{__DIE__}? by rrwo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.