in reply to Re^3: how to access hash key from the hash value when hash key is pointing to an array of hash values?
in thread how to access hash key from the hash value when hash key is pointing to an array of hash values?

One minor niggle, your results wording, "first found", implies some ordering in the hash which isn't there.

That's not true. You are visiting the hash of arrays in some order. It might not be meaningful or static, but it's why you don't end up visiting the same node twice.

The solution in question returns the first match encountered. It doesn't matter if the order will be different later, because you'd use it when you're expecting at most one match.

Update: Additions to clarify

  • Comment on Re^4: how to access hash key from the hash value when hash key is pointing to an array of hash values?