in reply to Flyweight Objects and garbage collection
Yes, it leaks memory, yes, you could write a DESTROY like
that, and internally Perl uses reference counting so that
your destructor should not be called until all references
are gone. (The current implementation will call it when the
last reference goes. This deterministic behaviour may or
may not survive. People like it and use it a lot, but
there is constant grumbling about implementing real garbage
collection some day.)