Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: What magic is this?

by gellyfish (Monsignor)
on Oct 26, 2006 at 12:56 UTC ( #580750=note: print w/replies, xml ) Need Help??


in reply to What magic is this?

Yes, when you use $SIG{__DIE__} it will get called if the program would die irrespective of whether there is an eval { } around the point that is dying, as you can see from:

$SIG{__DIE__} = sub { print "die handler: " , @_ }; + eval { die "DIE NOW"; }; + print "Still alive";
The program doesn't "die" but the "__DIE__" handler gets called nonetheless. This is the documented behaviour. You'll need to rethink the way you are handling errors.

/J\

Replies are listed 'Best First'.
Re^2: What magic is this? ($^S)
by tye (Sage) on Oct 26, 2006 at 13:27 UTC

    It isn't perfect, but that is what $^S is for. __DIE__ handlers usually should do nothing if $^S is true.

    - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://580750]
help
Chatterbox?
[Corion]: LanX: Ah, yeah - Frankfurt is in the quake region, but at the very border. I think I've never noticed a quake in Frankfurt myself
[marto]: good morning all
[Corion]: On another topic, in the process of Rubber Duck SoPWing, I wrote a post about the best API for generating HTTP requests (not sending them) and while writing it and fleshing out my sample implementation, I came up with some improvements to my ...
[Corion]: ... existing prototype. Cartesian Products will be proud of that module once it gets out ;)
[Corion]: Hi marto ;)

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2017-01-18 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (161 votes). Check out past polls.