Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: SIGDIE

by gaspodethewonderdog (Monk)
on Nov 20, 2000 at 23:59 UTC ( #42572=note: print w/ replies, xml ) Need Help??


in reply to SIGDIE
in thread BEGIN, END, eval and die.

Just to clarify things... when anybody executes a die the program is basically done. Even if you wrap an eval around it the script is still going to terminate?

The reason I am asking is because a module that somebody at work wrote executes a die when there is a request for data that doesn't exist. In the program he has used this for that might be a valid path of execution, but in the program I have written I can't just terminate. I was planning on wrapping an eval around the function call to trap it and more or less ignore it because for me it isn't fatal, but maybe eval won't help?

Just curious, because I'd rather not have to ask this guy to change his code and just deal with the problem myself. This man scares me to death, hehe ;)


Comment on Re: SIGDIE
Re: Re: SIGDIE
by Adam (Vicar) on Nov 21, 2000 at 00:53 UTC
    The basic rule is that if die is called, your program terminates. As with all rules, this one has exceptions. eval is like a separate program. The eval call will terminate, but will not end your program.

    However, it WILL call any handler you have defined in $SIG{__DIE__}. This is something you must keep in mind when writing a sigdie handler. Either check $^S, or don't plan on actually terminating. A large part of my post concerned the pitfalls surounding this point.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2014-12-29 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls