c:\@Work\Perl\monks>perl -wMstrict -le "my $hr = { foo => undef }; ;; warn qq{test A: 'foo' exists, undefined \n}; if (exists $hr->{foo}) { $hr->{foo} =~ /bar/; } ;; warn qq{test B: 'foo' exists, undefined \n}; if (exists $hr->{foo} && defined $hr->{foo}) { $hr->{foo} =~ /bar/; } ;; warn qq{test C: 'foo' exists, undefined \n}; if ($hr->{foo}) { $hr->{foo} =~ /bar/; } ;; $hr = {}; warn qq{test D: 'foo' does NOT exist \n}; if ($hr->{foo}) { $hr->{foo} =~ /bar/; } " test A: 'foo' exists, undefined Use of uninitialized value in pattern match (m//) at -e line 1. test B: 'foo' exists, undefined test C: 'foo' exists, undefined test D: 'foo' does NOT exist