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?
A unique textual identifier for each object. A name following rules and closely coupled to an object.
To get the actual reference, you'll call a class method like My::File->get_obj(symbol) to lookup in %My::File::instance
That's the "weakest" way...
This allows to designs systems where warnings like "object (File/Directory) doesn't exist anymore" are possible. Think inodes!
Also keep in mind that Perl can reuse refs for new variables after destructions, tho I doubt this happens when there is still a weakened ref around. (?)
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
|
|---|
| 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 hv (Prior) on Jan 21, 2024 at 18:33 UTC | |
by LanX (Saint) on Jan 21, 2024 at 19:37 UTC |