learnedbyerror has asked for the wisdom of the Perl Monks concerning the following question:

Oh Monks,

I again need your enlightened opinions. I am looking at using one of the n-ary tree modules (i.e. Tree, Tree::Simple, Forest ...) to model the relationship between two entities (Locations and Equipment) so that I can generate a generalized view to display the nested hierarchy as well as query parents, siblings and children.

Both entities are defined in a relational database.

The location records contain a parent location field.

The equipment records contain location and parent equipment fields, of which only one can be populated.

Some rules:

An example in reference syntax

LocationA = { Equipment1 => {}, LocationB => { Equipment2 => {}, Equipment3 => { Equipment4 => {}, Equipment5 => {}, }, }, LocationC => { LocationD => { Equipment6 => {}, Equipment7 => { Equipment8 => {}, Equipment9 => {}, }, }, }, }

My questions are:

  1. Given the above scenario, do you have a recommendation on which module to use? On what do you base this recommendation - experience, history, support ...
  2. Please provide links to any examples or projects of which you are aware from which I can learn.

Thank you in advance,

lbe