$ perl test.pl
Deep recursion on subroutine "Tree::_fix_height" at
/usr/local/share/perl/5.26.2/Tree.pm line 333 (#1)
(W recursion) This subroutine has called itself (directly or indirectly)
100 times more than it has returned. This probably indicates an
infinite recursion, unless you're writing strange benchmark programs, in
which case it indicates something else.
This threshold can be changed from 100, by recompiling the perl binary,
setting the C pre-processor macro PERL_SUB_DEPTH_WARN to the desired value.
Uncaught exception from user code:
Deep recursion on subroutine "Tree::_fix_height" at /usr/local/share/perl/5.26.2/Tree.pm line 333.
Tree::_fix_height(Tree=HASH(0x5614409803c0)) called at /usr/local/share/perl/5.26.2/Tree.pm line 333
Tree::_fix_height(Tree=HASH(0x561440992cc8)) called at /usr/local/share/perl/5.26.2/Tree.pm line 333
.
.
.
####
(W recursion) This subroutine has called itself (directly or indirectly)
100 times more than it has returned.
##
##
This threshold can be changed from 100, by recompiling the perl binary,
setting the C pre-processor macro PERL_SUB_DEPTH_WARN to the desired value.
##
##
#!/usr/bin/perl
use strict;
use warnings;
use Tree;
my $tree = Tree->new('root');
foreach my $i (0..200){
$tree->add_child( { at => $i }, Tree->new( "child $i" ) );
}
print "success\n";
__END__
$ perl test.pl
success