defined @{@$tree[$i]->{subtree}}
ref @$tree[$i]->{subtree}[0] eq "HASH"
QuoteIt used to report whether memory for that aggregate had ever been allocated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/usr/bin/perl -w use strict; my @Tree = ( { array => "", foo => 'bar' }, { array => [ { bar => 'foo'}, ] }, ); my $tree = \@Tree; print "ohne defined .$/" if @$tree[0]->{array}; print "defined.$/" if defined @$tree[0]->{array}; # defined print "ohne defined .$/" if @$tree[1]->{array}; print "defined.$/" if defined @$tree[1]->{array}; # ohne defined . # defined. # array bzw subtree ist manchmal kein array .