push @{ $parent->{children} }, $child; weaken( $child->{parent} = $parent ); # Needed to avoid memory leak.