use strict; my $myhash = { 1 => 'a', 2=> 'b', 3=> 'a', 4=>'c'}; for my $key (keys %{$myhash}){ if(${$myhash}{$key} eq 'a'){ print "KEY:$key\n"; } }