I was looking for a two way hashing solution, and ran across Tie::Hash::TwoWay - which is almost what i need. The drawback is that it starts misbehaving when the two sets being hashed are not disjoint. Any key operation, such as exists, first checks if the specified key exists in the "primary" hash direction, and if so, returns true. If not, it checks the "secondary" hash (the reverse mapping), and returns whether the key exists there.
I need a solution that allows me to specify that the operation should only look in the direction specified with that call. It would not be too hard to modify TwoWay, but i thought id ask if something similar exists. (i didnt find anything at cpan or here - which in no way means that it isnt there)