in reply to One to many hash question

Nope. Sorry.

A hash is “one-to-one” by nature. One hash-key leads to one result (which, of course, might be a list...) or to nothing. Them's your choices.

If you need to do a reverse lookup, you have a “you decide” decision to make:   what seems most appropriate for you, in this situation?

If you have large hashes and/or if you do these reverse lookups quite often, it might well be perfectly justifiable to maintain two hashes. The hash that's designed for reverse lookups would of course contain “a reference to a list” as its hash-target.

On the other hand, you might decide that in your case it's acceptable or even preferable to iterate through all the keys in the hash, examining the values one-by-one.

Bottom line is... “oh esteemed Software Designer, it's your choice, and yours alone. That's why they pay you the Big Bucks.” ;-)