That's a classic! :)
Hash-keys are always stringified and there is no "direct" way to dereference the stringification.
BUT you are free to keep the original ref somewhere. Either as value in your data-structure or in a separate hash with $ref_of_str{"$key_hash"}=$key_hash. ¹
Thats much safer BTW cause a string doesn't increment the reference count ... i.e. keeping the reference somewhere protects the data from destruction if ref-count reaches 0.
(I hope it's clear now why dereferencing a string will hardly be ever possible)
HTH! :)
Cheers Rolf
(addicted to the Perl Programming Language)
¹) I rarely come into situations where I really need this trick. I'm sure your data-structure could be rewritten to avoid this, but tl;dr...
In reply to Re: Use a hashref as a key in another hashref?
by LanX
in thread Use a hashref as a key in another hashref?
by mwb613
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |