my $p = $href; for (@keys) { return 0 if !exists($p->{$_}); $p = $p->{$_}; } return 1;