more useful options | |
PerlMonks |
Re^2: try catch getting ignored by SIG DIE subroutineby dkhosla1 (Sexton) |
on Feb 25, 2018 at 20:16 UTC ( [id://1209939]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|