in reply to Iterating over hash contents?

If you also want the keys to those elements whose values match your data, try this:
my @keys_for_matching_values = grep { $hash{$_} eq $variable } keys %hash;