Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Throw from within a DESTROY block

by ikegami (Pope)
on Sep 07, 2011 at 00:11 UTC ( #924490=note: print w/ replies, xml ) Need Help??


in reply to Re: Throw from within a DESTROY block
in thread Throw from within a DESTROY block

I was going to mention the possibility of using a $SIG{__DIE__} that calls exit, but it doesn't work. The signal is triggered before the object is destroyed, so a second attempt to destroy the object occurs during global destruction.


Comment on Re^2: Throw from within a DESTROY block
Select or Download Code
Re^3: Throw from within a DESTROY block
by ribasushi (Monk) on Sep 07, 2011 at 02:04 UTC
    This can be trivially fixed by closing over an $already_fired flag of some sort to neutralize the DESTROY for a specific object. However I am not interested in an exit() - I want a real trappable exception that will happen during runtime calls to DESTROY (I am not interested in the global destruction case, and can always work around it)

Log In?
Username:
Password:

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

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

    How do you remember the number of days in each month?











    Results (163 votes), past polls