in reply to Deleting from Hash-of-Hash using references

Think of it this way, delete needs to pieces of information: the hash you delete from, and the key. $href1 is a reference to the *value* belonging to $HoH{flintstones}, while $href2 is the value itself.

Given the reference, there's no way to find which key it belongs to. In fact, the value could appear several times in the hash, or even in different hashes.

  • Comment on Re: Deleting from Hash-of-Hash using references

Replies are listed 'Best First'.
Re^2: Deleting from Hash-of-Hash using references
by dol (Novice) on Nov 27, 2011 at 00:01 UTC

    When you put it that way it makes sense. I thought I was referring to the key (which then in turn would point to the value and location), not the actual value in the hash.

    Thanks for the help.