Tree, Tree::Binary, Tree::DAG_Node, Tree::Persist and Forest


I wanted to title this post: The Tree::Hugger Chronicles: Tree, etc, but that was too long.

Anyway, I mention Forest only to say I won't mention it further.

I've become co-maint (or accidentally, owner) of various Tree-ish modules, so I thought I mention what's up. Each module is followed by an extract from the CHANGES file.

o Tree: I've just released V 1.03:
- Rename Tree::Binary to Tree::Binary2 so it no longer clashes with the Tree::Binary shipped in the Tree-Binary distro. MetaCPAN was getting confused, and automatically redirected links from this module's Tree:Binary to the other one.

o Tree:Binary: No activity.

o Tree::DAG_Node. I've just released V 1.06:
- Pre-emptive apologies for any changes which are not back-compat. No such problems are expected, but the introduction of new methods may disconcert some viewers.
- Fix RT#78858, reported by Gene Boggs. Audit code for similar problems.
- Fix RT#79506. reported by Ron Savage.
- Rename ChangeLog to CHANGES, and add Changelog.ini.
- Replace all uses of cyclicity_fault() and Carp::croak with die.
- Remove unused methods: decommission_root(), cyclicity_allowed(), cyclicity_fault(), inaugurate_root(), no_cyclicity() and _update_links(). OK - cyclicity_fault() was called once. It just died.
- Add methods: format_node(), hashref2string(), is_root(), node2string(), tree2string().
tree2string($opts, $node) - unlike draw_ascii_tree() - can optionally print the tree starting at any node. Override format_node(), hashref2string(), and node2string() if desired.
- Reformat the POD big-time.
- Add Build.PL.
- Re-write Makefile.PL.
- Remove use vars(@ISA $Debug $VERSION). Replace latter 2 with 'our ...'.
- Rename t/00_about_verbose.t to t/about.perl.t.
- Add scripts/ Warning: Some trees get into an infinite loop.
- Add t/cut.and.paste.subtrees.t. Warning: Some trees get into an infinite loop.
- Document the options (discouraged by Sean) supported in the call to new($hashref).

o Tree::Persist. No activity.
In fact I'm not yet co-maint of this, due to a typo by $name_elided who removed himself as owner rather than make me co-maint.
A fix from the CPAN admins is taking so long I decided to volunteer to become an admin rather than complain, but that matter is still up in the air. Perhaps nothing will come of it.

Also, as I release updates, I'm adding some common POD to each. Just a See Also so far, with a little FAQ.

And why do this? Well, I've been doing a lot of work which required a tree data structure, will parsing Graphviz *.gv files, and ended up using Tree::DAG_Node after switching back and forth between it and Tree, because the former is so good. But I'm aware it was criticised for having no meaningful tests, so I wrote a test which cuts-and-pastes a few sub-trees. But be warned, such code can easily get into an infinite loop, so don't copy it mindlessly.

As for the Graphviz work, that deserves a separate blog entry.


Re: Tree::Persist. I thought I fixed perms up on that one. Can you check again?


You should simply have titled it “The Tree::Hugger Chronicles”. Less is more and punchy better. :-)

Leave a comment

About Ron Savage

user-pic I try to write all code in Perl, but find I end up writing in bash, CSS, HTML, JS, and SQL, and doing database design, just to get anything done...