in reply to Re: references to elements of tied hashes
in thread references to elements of tied hashes

So, it's a year and a half later and this gets me again in a way I can't solve: I have a self-referential hash. I use WeakRef to weaken the hash elements to avoid leaking/growing programs. But if I tie the hash I can't find any way to weaken the tied references. Any ideas besides shooting me in the head?

  • Comment on Re^2: references to elements of tied hashes

Replies are listed 'Best First'.
Re^3: references to elements of tied hashes
by steves (Curate) on Sep 11, 2004 at 23:26 UTC

    Question related to this: Are stringified references used as hash keys unique? That is, if I only ever use them to look hashed values for given references up, do I need to use something like Tie::RefHash? I've gotten into the habit of using Tie::HashRef whenever I use references as hash keys. I realize now that in many cases I'm never trying to dereference the keys -- only take a reference and find its hashed value. So in the case above, I probably don't need a tie and I can therefore weaken the self referential reference I'm using as a key. The hash in question is always hashing references to bless'ed hashes of the same object (package) type.