perl -wMstrict -e "my %hash = (foo => 'x', bar => '', baz => undef); for (qw/foo bar baz quux/) { printf qq($_ exists:%s: $_ defined:%s: $_ true:%s: \n), exists($hash{$_}), defined($hash{$_}), $hash{$_} ? 1 : '' }" foo exists:1: foo defined:1: foo true:1: bar exists:1: bar defined:1: bar true:: baz exists:1: baz defined:: baz true:: quux exists:: quux defined:: quux true::