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

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

Thread Previous | Thread Next
Arthur Bergman
August 20, 2003 02:53
Re: [perl #10030] DESTROY not called on code reference objects
Message ID:

On Wednesday, August 20, 2003, at 04:31  am, Kurt Starsinic wrote:

> So it seems to me that, in Perl, a named subroutine is never a
> closure, and an anonymous subroutine is always a closure.  The fact
> that perl optimizes the special case of an anonymous subroutine with 0
> private bindings is an implementation detail of interest to a tiny few.
> This behavior is not guaranteed, and based on Simon's bug, I suspect
> that it will change.

I would say an anonymous subroutine is just that, an anonymous 
subroutine. It needs outside lexicals to be a closure.

However, I also think this issue is totally irrelevant since only a 
select few are evil enough to do anything about it, and it is trivial 
to have a wrapper object around it. Slowing down all anonymous 
subroutines is just silly. Just document it, close the bug and get on 
with life.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About