Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: try catch getting ignored by SIG DIE subroutine

by dkhosla1 (Sexton)
on Feb 25, 2018 at 20:16 UTC ( [id://1209939]=note: print w/replies, xml ) Need Help??


in reply to Re: try catch getting ignored by SIG DIE subroutine (updated!)
in thread try catch getting ignored by SIG DIE subroutine

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.

  • Comment on Re^2: try catch getting ignored by SIG DIE subroutine

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1209939]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-26 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found