Thanks for the insight and the various options:

- Thanks for the $@ vs. $_ in Try::Tiny. It was right there in first example in the docs and somehow missed it!

- The __DIE__ & __WARN__ handling is a lot more complex in the real code. This is in a common library used bu a lot of apps. This code snippet was with some minimal lines. 'die' is being called all over the code to fill some special logs with formatted messages and some other processing, code setting etc. before exiting. Maybe, as recommended, I can clean it up a little and make it simpler. Will review the docs some more. I had struggled with the exit ($?) from __DIE__ vs. regular exit in the END block. Thanks for the clarification. The $_exitcode type solution will help.

- Looks like the example from Athanasius is what I can safely try for now with your 'local' enhancement. Seems cleaner.


In reply to Re^2: try catch getting ignored by SIG DIE subroutine by dkhosla1
in thread try catch getting ignored by SIG DIE subroutine by dkhosla1

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.