Skip to content

Instantly share code, notes, and snippets.

@karupanerura
Created May 9, 2014 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karupanerura/556ed4260bf43ebd2a5d to your computer and use it in GitHub Desktop.
Save karupanerura/556ed4260bf43ebd2a5d to your computer and use it in GitHub Desktop.
sub existsr (\%@) {## no critic
my $h = shift;
for my $k (@_) {
return !1 unless exists $h->{$k};
$h = $h->{$k};
}
return !!1;
}
my %h = (
aaa => {
bbb => {
ccc => "ddd"
}
}
);
say existsr %h, qw/aaa bbb ccc/;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment