in reply to Bi-Directional Hash Lookup
If what bothers you is having "two" for what is "one" thing, then you're giving it up -or better: trading it- for the advantage of hash lookup.my %hash=(a => 'foo', b => 'bar', c => 'baz'); my %reverse; @reverse{values %hash}=keys %hash; # if(f) values are unique, as you c +laim.
To re-gain the psychological feeling of unity you may make them into a single HoH with keys qw/direct reverse/ associated to the "direct" and "reverse" hashrefs.
|
|---|