That explains a lot. "Strange action at a distance" is a lot more polite than what I would call it though. Storable is a pretty important core module, and the resulting error message makes absolutely no sense to the user.

When perlvar says "Do not use this to ..., or as a bizarre substitute for overriding CORE::GLOBAL::die()", what exactly do they mean? I though that the entire purpose of $SIG{__DIE__} was exactly for overriding the global die() functionality.

Perhaps my question should permute into this:

I have a ton of code, much of it in modules, which in turn use other modules I've written, which in turn also use some 3rd party and/or core modules. When I execute the top level scripts that drag all of this in, I would like to enforce that all die()s and warn()s that happen, regardless of the module they occur in, call my special die/warn handlers to handle all of the error output in a consistent fashion.

Since there are many top-level scripts, I would prefer to wrap the die/warn-handling code into another module, say named "MyProject::ErrorHandler", which I include in the top level scripts and/or the various modules I have control over. How does one go about accomplishing this correctly, without screwing up die()'s that occur in evals, which some modules (even my own) depend on.


In reply to Re^2: SIG{__WARN__}, Storable, and Log::Agent... by ph713
in thread SIG{__DIE__}, Storable, and Log::Agent... by ph713

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.