Subject: | add_child() behaviour is erratic |
Hi Folks
For a tree which has never been serialized to disk, or has been cloned,
add_child(Tree -> new(...) ) and add_child({at => $i}, Tree -> new(...)
) both work.
For a tree written to disk, or read from disk, the first form works, but
the second form dies with: Can't call method "LEVEL_ORDER" on unblessed
reference at
/home/ron/perl5/lib/perl5/Tree/Persist/DB/SelfReferential.pm line 104.
The line in question is:
my $traversal = $tree->traverse( $tree->LEVEL_ORDER );
When {at => $i} is used, line 150 calls _create() with a hash which is
not blessed into the Tree class.
I haven't figured out yet why that is, but I have a demo which
invariably fails at this point, so I'm looking in to it.