my %hash = ( a => { ab => { ac => 'yup', }, }, ); # Check for existence if (exists $hash{aa}->{ab}->{ac}) { ## Notice that 'aa' is a typo an doesn't exist ## but will be auto-created and now contain a ## hash ref with one entry 'ab'. print "ac exists.\n"; ## won't get printed } if (exists $hash{aa}) { ## This will succeed because $hash{aa} was auto ## created above. print "aa exists.\n"; ## will get printed } #### if exists $hash{aa} ## exists doesn't check this ->{ab} ## Nor this ->{ac} ## Ah ha! exists does check here ;