Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re (tilly) 3: Reverse Inheritance Irritance

by tilly (Archbishop)
on Mar 28, 2001 at 09:03 UTC ( [id://67748]=note: print w/replies, xml ) Need Help??


in reply to Re: Re (tilly) 1: Reverse Inheritance Irritance
in thread Reverse Inheritance Irritance

I was seriously confused about this. After a bit of debugging I figured it out though. Here is a simple example that shows what is going on:
my $test = sub {bless {}}; $test->(); $test->(); $test->(); sub DESTROY { print "Calling DESTROY\n"; die "But you won't see this message\n"; }
See it?

DESTROY is called in an eval. Since my code was only putting out output within a confess, that output was trapped. So I saw nothing, the script kept on going, and I thought that DESTROY wasn't being called. When in fact it is...

Mystery solved. :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-23 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found