in reply to Re^2: Use a hashref as a key in another hashref?
in thread Use a hashref as a key in another hashref?

Sure that's why you have to keep the original unweakend ref for each key!

The keystrings are guaranteed to be unique as long as the ref count is positive.

And as soon as a hash entry is deleted the shadow entry should be deleted too.

This could best be synchronized with a tied hash or a dedicated object.

And that structure can be safely passed around then.(CPAN to rescue! ;)

But as I already said this is rarely worth the trouble, avoiding refs as keys is the better design decision.

Cheers Rolf

(addicted to the Perl Programming Language)

  • Comment on Re^3: Use a hashref as a key in another hashref?