Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Controlling the order of object destruction

by dave_the_m (Monsignor)
on Dec 10, 2009 at 17:19 UTC ( [id://812250]=note: print w/replies, xml ) Need Help??


in reply to Controlling the order of object destruction

The order is not guaranteed, although the current behaviour happens to be that the reference count decrement is in reverse order of execution of the corresponding 'my' expressions. For example:
sub DESTROY { print "$_[0][0] destroyed\n" } { my $x1 = bless [ "x1" ]; goto L2; L1: my $x2 = bless [ "x2" ]; goto L3; L2: my $x3 = bless [ "x3" ]; goto L1; L3: } __END__ x2 destroyed x3 destroyed x1 destroyed

Dave.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-19 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found