Skip Menu |

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

Report information
The Basics
Id: 30032
Status: resolved
Worked: 40 min
Priority: 0/
Queue: Tree-Simple

People
Owner: Nobody in particular
Requestors: mosesamaro [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.17
Fixed in: 1.18



Subject: Bug using includeTrunk with a PreOrderTraversal.
The includeTrunk() method does not seem to work with the preOrderTraversal visitor. Specifically, calling IncludeTrunk(1) on your visitor object ala... $visitor->includeTrunk(1); Does not cause the visitor to include the root of the tree in its traversal. I managed to fix the issue with with the following change. In Visitor.pm line 106: I replaced: $func->($tree) unless defined $self->{_include_trunk}; with the following lines if(defined $self->{_include_trunk}) { if($self->{_include_trunk}){ $func->($tree) } } That seems to fix the issue for me. I haven't tested it throughly though. Thanks for the great module. I learned a lot about Perl just by looking through your code. The way you wrote the $func function is totally new to me, and just by reading that I learned a great new programming technique. - Moses
Hi Moses I (Ron) have taken over maintenance of Tree::Simple. I know it's been a long time since you logged this report, but... I've adopted you patch for V 1.19. $many x $thanx;