Hi Guys,
Why does a Perl expression acting on an empty nested hash element create parents for the element eg:
#!/usr/bin/perl -w use strict; use warnings; my %a; my $a = scalar keys %{a}; print $a,"\n"; if (not exists $a{a}{a}{a}){ $a = scalar keys %{a}; print $a,"\n"; } print "End\n";
prints:
0 1 End
not
0 0 End
And is the only way to avoid this, to check the higher levels of the hash first?
Regards
Steve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |