This begs the question as to whether your data structure is appropriate. Perhaps your keys and values are backwards? Perhaps you have two sets of keys, and should therefore have two hashes?
my $person = { id1 => $id1, id2 => $id2, name => $name }; $persons_by_id1{$id1} = $person; $persons_by_id2{$id2} = $person; ... my $id2 = $persons_by_id1{$id1}{id2};
In reply to Re: Obtain Key from Hash using value
by ikegami
in thread Obtain Key from Hash using value
by twaddlac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |