exilepanda has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
Result :use Data::Dumper; $x = {}; 1 if ( exists $x->{W} ) ; 1 if ( defined $x->{X} ) ; 1 if ( $x->{Y} ) ; 1 if ( exists $x->{Y}{X} ) ; 1 if ( defined $x->{Z}{A} ); print Dumper $x;
What I don't want is Z, Y create by itself, when I try to check if some keys from inner are existed or not. Can I do that ? Hopefully this won't be the only solution$VAR1 = { 'Z' => {}, 'Y' => {} };
Any clues? Thank you very much!if ( $x->{Y} ) { if ( $x->{Y}{Z} ) { 1 if ( $x->{Y}{Z}{A} ) ; } } ; # $VAR={};
Back to
Seekers of Perl Wisdom