Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Custom SIG DIE handler that isn't executed in evals

by tunafish (Beadle)
on Sep 14, 2016 at 04:14 UTC ( #1171718=note: print w/replies, xml ) Need Help??


in reply to Re^2: Custom SIG DIE handler that isn't executed in evals
in thread Custom SIG DIE handler that isn't executed in evals

But what to do when the eval is deep within a bunch of system modules? I'm receiving e-mails right now from my script because of an eval located in /usr/local/lib64/perl5/XSLoader.pm
  • Comment on Re^3: Custom SIG DIE handler that isn't executed in evals

Replies are listed 'Best First'.
Re^4: Custom SIG DIE handler that isn't executed in evals
by Anonymous Monk on Sep 14, 2016 at 04:35 UTC

    But what to do when the eval is deep within a bunch of system modules?

    see perlvar#$^S

Re^4: Custom SIG DIE handler that isn't executed in evals
by RonW (Vicar) on Sep 14, 2016 at 18:51 UTC

    Expanding on what the anony monk said, your die handler can test if the die happened in an eval.

    So, maybe the following:

    # not tested sub SigDieHandler { unless ($^S) # skip if die happened in an eval { ...; # create and send email } }

    Not tested, YMMV.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1171718]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2017-12-11 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (319 votes). Check out past polls.

    Notices?