in reply to Problem using object references as hash keys

As noted above, you can put references in hash keys, but you cannot get them back as refs, because hash keys in normal hashes are always strings.

I believe you might want Tie::RefHash.

edit: though I've never had to use it - I generally find using an extra hash or array easier to understand.

Joost.

  • Comment on Re: Problem using object references as hash keys

Replies are listed 'Best First'.
Re^2: Problem using object references as hash keys
by jlf (Scribe) on Jun 10, 2004 at 00:15 UTC
    Thank you for the reference -- that module looks like just the ticket if I can't successfully parse eric256's later reply, which appears to be a suggestion about how to do what I want without bringing in any additional modules.