sub leaves_under { # read-only method: return a list of all leaves under myself. # Returns myself in the degenerate case of being a leaf myself. my $node = shift; my @List = (); # $node->no_cyclicity; $node->walk_down({ 'callback' => sub { my $node = $_[0]; my @daughters = @{$node->{'daughters'}}; push(@List, $node) unless @daughters; return 1; } }); Carp::croak "Spork Error 861: \@List has no contents!?!?" unless @Li +st; # impossible return @List; }
In reply to spork error by erabus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |