>perl -wMstrict -le "my %hash = qw(a 1 b 2); print 'true 1st level' if $hash{c}; print exists $hash{c} ? '' : 'NOT ', 'exists 1 c'; print 'true 2nd level' if $hash{c}{d}; print exists $hash{c} ? '' : 'NOT ', 'exists 2 c'; print exists $hash{c}{d} ? '' : 'NOT ', 'exists 2 d'; " NOT exists 1 c exists 2 c NOT exists 2 d