%hash1 = ('A' => 1); $href = \%hash1; foreach my $name (keys %main::) { if ($href eq \%{"main::$name"}) { print "Hash ref is for %",$name,"\n"; } }