And then there's the third way which requires some extra typing, but is fine for two-level or three-level hashes:
my $r = $hashref; # better to use a short variable name here if($r->{a} and $r->{a}->{b} and exists $r->{a}->{b}->{c}) { # Do something }
In reply to Re^2: I just want to understand why ...
by Anonymous Monk
in thread Why does testing for the existence of hash keys create the keys ?
by fshrewsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |