in reply to Re^2: Should I use weaken on an object attribute containing a reference to an object which contains reference back to original object?
in thread Should I use weaken on an object attribute containing a reference to an object which contains reference back to original object?

I have trouble imagining a file system where dirs and files are deleted implicitly after "falling out of scope".

I've re-read the OP. It doesn't seem to mention anything about actually operating on a filesystem. Rather it's just an example of collections of related objects or references.


🦛

  • Comment on Re^3: Should I use weaken on an object attribute containing a reference to an object which contains reference back to original object?

Replies are listed 'Best First'.
Re^4: Should I use weaken on an object attribute containing a reference to an object which contains reference back to original object?
by LanX (Saint) on Jan 23, 2024 at 15:12 UTC
    The OP wants a general advice for weaken with an ambiguous OO design.

    My point in 3 posts already is that it's not possible to answer a fuzzy question, because different readers will have different use cases in mind.

    That's a bad ground to discuss weaken thoroughly. Bad question, useless answer.

    A conclusion like

    > > > But there's also a problem with using weaken.

    looks problematic to me.

    FWIW: The only general advice I found in the perldocs on weaken is to use it on the shorter lived ref.

    Update

    Creating a decent discussion/tutorial for weaken would be nice.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery