#! perl use strict; use warnings; my %HoA = ( no1 => [ 'c', 'd' ], yes1 => [ 'X' ], no2 => [ 'e', 'e', 'f' ], yes2 => [ 'a', 'X', 'b' ], ); my $a = 'X'; for my $key (keys %HoA) { print "Element '$a' found, key = $key\n" if grep {$_ eq $a} @{ $HoA{$key} }; } #### 13:00 >perl 1095_SoPW.pl Element 'X' found, key = yes2 Element 'X' found, key = yes1 13:12 >