develooper Front page | perl.perl5.porters | Postings from August 2003

Re: [perl #10030] DESTROY not called on code reference objects

Thread Previous | Thread Next
From:
Simon Cozens
Date:
August 18, 2003 10:55
Subject:
Re: [perl #10030] DESTROY not called on code reference objects
Message ID:
20030818164529.GA14536@alias.simon-cozens.org
Yitzchak Scott-Thoennes:
> > >     my $y;
> > >     { my $x = bless sub { $y }, 'X'; }
> > >     sub X::DESTROY { print "DESTROYED\n" }
> > Don't document bugs as features.  You will hate yourself in the morning.
> 
> My initial reaction is to disagree.  On second thought, I'm not so
> sure.

My initial reaction is that calling a destructor on a sub that happens
to be a closure and not on one that doesn't is not just an unexpected
special case, but it's surely a bug. Why (and I ask this honestly, not
rhetorically) is it supposed to be so hard to fix?

-- 
   User: In 1793 the french king was executed.
MegaHAL: HA HA HA! CORRECT. ALTHOUGH, EXECUTED HAS MULTIPLE MEANINGS. 

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About