use strict; use warnings; $a = {"a" => 1, "b" => 2, "c" => undef}; print "c exists\n" if (exists($a->{"c"}));#c exists, although its value is undef print "d exists\n" if (exists($a->{"d"}));#d does not exist