Ahhhhh. I understand your reasoning for using $^S now. Thanks for the clarification...

I guess the only remain point of confusion I have is about die itself. perlfunc isn't clear on this, as I read it. When something "blows up" in a script, is die what perl invokes, under the covers? It seems not to be, except when it is (so to speak). Consider this code:

# $SIG{__DIE__} = sub { print "I died.\n"; exit 0 }; BEGIN { *CORE::GLOBAL::die = sub { print "Died in the new die.\n"; exit 0; }; } print "Requiring something bogus.\n"; require "bogus"; print "Done requiring something bogus.\n";

When I leave the $SIG line commented out, I do not see "Died in the new die". When I uncomment the $SIG line, however, I do see "I died". That's counter-intuitive, since you wouldn't think that $SIG{__DIE__} would fire in the absence of an actual call to die.

Anyway, as a result of that, I'm inclined to go with the $SIG approach after all, since it seems to catch this kind of a failure -- which is what I'm trying to accomplish. Thanks again!


In reply to Re^4: logging, to include unhandled exceptions by klassa
in thread logging, to include unhandled exceptions by klassa

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.