in reply to Hash in Perl

That's a FAQ. Search for discussions about "inverting hash", e.g.  inverting hash / grouping values

Cheers Rolf

( addicted to the Perl Programming Language)