Subject: | Nodes named 0 are clobbered |
use Tree::DAG_Node;
my $tree = Tree::DAG_Node->lol_to_tree([[0,'null']]);
print join("\n", map { $_ } @{$tree->draw_ascii_tree}), "\n";
The above code produces this:
|
<Tree::DAG_Node=HASH(0x100887108)>
|
<foo>
|
<Tree::DAG_Node=HASH(0x10088b750)>
The terminal node is supposed to be named "0." Knowing it was a problem
of "defined vs true", I traced the bug and making this little change to
Tree/DAG_Node.pm fixes the naming:
2354c2354
< $printable_name = $it->name || $it;
---
Show quoted text
> $printable_name = defined $it->name ? $it->name : $it;
|
<Tree::DAG_Node=HASH(0x100887138)>
|
<foo>
|
<0>
Regards,
Gene Boggs