On Wed, 20 Dec 2000, Radovan Semancik wrote:
> I have perl objects with cyclic refferences to each othen in mod_perl
> environment. I know that these objects will never be freed unless I
> break the refference cycle. But, how to do it transparently for user of
> object?
What you need to do is to have a "starting" node in your
reference cycle that doesn't have anything pointing to it. Such as the
"head" pointer of a linked list. If the DESTROY method of this object
were to explicitely call some clean-up method of yours that is in the
regular node objects (clearing internode references), then the whole
process should be transparent to the user because all they have to do is
remove any references to the starting node, and they all vanish. If your
entire set of linked objects is encapsulated in another one, then that
would effectively be your "start".
// Darren Duncan