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:
Dave Mitchell
Date:
August 18, 2003 13:33
Subject:
Re: [perl #10030] DESTROY not called on code reference objects
Message ID:
20030818181208.GA1631@fdgroup.com
On Mon, Aug 18, 2003 at 05:45:29PM +0100, Simon Cozens wrote:
> 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?

Assuming that we wish to keep the optimisation of sharing non-closure anon
CVs, then the problem is that by the time you try to bless the coderef,
its already pointing to the shared CV, and you're buggered. By then, you
don't really have the option of unsharing it. At least I can't think of
a clean way.

-- 
A walk of a thousand miles begins with a single step...
then continues for another 1,999,999 or so.

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