in reply to Hash of hash: testing for existence of higher level key (only)
I thought of ... but I don't think that would work ...
But what happened when you tried it?
>perl -wMstrict -le "my $hash = { 'A' => { 'B5' => { 'C' => 123, 'D' => 103, }, 'B2' => { 'C' => 101, }, }, }; ;; if (exists $hash->{'A'}{'B2'}) { for my $k (keys %{ $hash->{'A'}{'B2'} }) { print qq{'$k' -> $hash->{'A'}{'B2'}{$k}}; } } " 'C' -> 101
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hash of hash: testing for existence of higher level key (only)
by zuma53 (Beadle) on Jun 22, 2012 at 05:23 UTC |