in reply to Is there a penalty for namespace use?

$self->{self} = $self;
You are creating a reference loop which stops the objects being freed. Note also that it's unusual to explicitly call DESTROY()

Dave.

Replies are listed 'Best First'.
Re^2: Is there a penalty for namespace use?
by diotalevi (Canon) on Dec 30, 2004 at 04:20 UTC
    Not only is it unusual, it is incorrect. Perl itself will call DESTROY for you when it is about to lose its last reference to an object. You should never call the DESTROY method yourself because the object *isn't* being destroyed when you call the function.