Created
May 9, 2014 06:24
-
-
Save karupanerura/556ed4260bf43ebd2a5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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