jonathan415 has asked for the wisdom of the Perl Monks concerning the following question:
$href = { 'a' => { 't' => { 'x' => { '2008-08-07' => 1 } } } 'b' => { 'd' => { 'o' => { '2008-08-06' => 1 } } } };
I know that I could see if $href->{a}->{t}->{x}->{2008-08-07} exists by just typing:@array = ('a', 't', 'x', '2008-08-07');
But that would be too statically hard encoded and manual.if (exists $href->{a}->{t}->{x}->{2008-08-07} ){ print "href value exists"; }
I'd like to check if:@array2 = ('b', 't', 'm', 'p');
exists without typing out "b, t, m, p".$href->{b}->{t}->{m}->{p}
|
---|