$ perl -wE' my %hash = ( a => 1 ); if (defined $hash{b}) { 1 } say "defined b: ",keys %hash; if (exists $hash{c}) { 1 } say "exists c: ", keys %hash; if (defined $hash{B}->{foo}) { 1 } say "defined deref B: ", keys %hash; if (exists $hash{C}->{foo}) { 1 } say "exists deref C: ", keys %hash; ' defined b: a exists c: a defined deref B: aB exists deref C: aCB