On Tue, Feb 13, 2001 at 01:09:11PM -0500, John Porter wrote:
> > James Mastros wrote:
> > >"It isn't possible to AUTOLOAD DESTROY." --perlmem(6)
[Note: that's a hypothetical quote.]

> I'm not sure what that means.  Certainly AUTOLOAD gets
> called if DESTROY is called but not defined ... just
> like any other method.
The idea is [for Larry] to declare "no, it isn't".  Otherwise, you have to
do refcounting (or somthing like it) for DESTROY to get called at the right
time if the class (or any superclass) has an AUTOLOAD, which is expensive.

Perhaps you could declare, but not define, DESTROY to have AUTOLOAD called
for DESTROY, and have DESTROY called as soon as the last ref goes out of
scope.  (IE have a sub DESTROY; line.)

        -=- James Mastros
-- 
"All I really want is somebody to curl up with and pretend the world is a
safe place."
AIM: theorbtwo       homepage: http://www.rtweb.net/theorb/

Reply via email to