my %hash = ('a' => undef, 'b' => undef, 'c' => undef, 'd' => undef); if (exists $hash{'a'}) { # yadda yadda }