my %childtables; foreach my $child (@{$ele->child()}){ my @arr; if($childtables{${$ele->doc_type()}}[0]) { #line 215 @arr = @childtables{${$ele->doc_type()}}; } push(@arr,$child); @childtables{${$ele->doc_type()}} = @arr; }