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

Re: exception handling (the weird way)

by MZSanford (Curate)
on Mar 08, 2002 at 09:17 UTC ( #150262=note: print w/ replies, xml ) Need Help??


in reply to exception handling (the weird way)

Only one suggestion. I would nomally do the following change :

# old *CORE::GLOBAL::die = \¨ # new $SIG{__DIE__} = \¨
Not that either is better per-se, but somehow i feel the %SIG method is cleaner... maybe because i shy away from ever writting *CORE:: ... everytime i do, i hurt myself :/
from the frivolous to the serious


Comment on Re: exception handling (the weird way)
Select or Download Code
Re: Re: exception handling (the weird way)
by Felonious (Chaplain) on Mar 08, 2002 at 16:24 UTC
    Unfortunately, that will not work. The $SIG{__DIE__} handler is simply called before die() does it's thing. After the handler exits, die() continues on (unless you call die again within the handler). In order to make the block continue executing when the exception is "handled", I have to make a new version of die smart enough not to actually do it in that case.

    Perhaps there should be a means of controlling whether it acts "globally" or not.

    P.S. I wrote the original post, and posted it "anonymously" by accident. Doh!

    -- O thievish Night, Why should'st thou, but for some felonious end, In thy dark lantern thus close up the stars? --Milton

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2014-04-19 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls