Skip Menu |

This queue is for tickets about the Tree-DAG_Node CPAN distribution.

Report information
The Basics
Id: 78858
Status: resolved
Priority: 0/
Queue: Tree-DAG_Node

People
Owner: Nobody in particular
Requestors: gene [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.06
Fixed in: (no value)



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
Hi Gene Fixed in V 1.07