if (exists $hash{'d'} and !$hash{'d'}->{'value'}) { print "That key doesn't exist. Valid keys are: "; print join (", ", keys %hash); }