In the ought to exist category, there ought to be a Perl module for automatically maintaining a tree structure using Celko’s modified pre-order traversal method. It’s not all that complicated, but it would be handy to have someone else build one. Key features

  1. your basic tree methods, insert, updated, remove (including either re-parenting, or trimming that branch), getChildren, getParent, pathToNode. All pretty easy with MPTM.
  2. multiple trees per table, none of the examples model this, but one tree per table is an edge case not the norm.
  3. be really nice if it did integrate smoothly with Class::DBI, nodes of the tree being Class::DBI objects, using the columns() method to identify primary keys, and lft and rgt columns.
  4. extra credit includes methods for balancing the tree, and support Celko’s suggestion to use ranges rather then sequential numbering for tables with frequent updates. (I’ve created a bugmenot account)