in reply to Perl modules or standard tools for searching hierachical data

If you have enough memory, you could build up a dependency tree. Otherwise, I think you have to make multiple passes.

For each entry:

  1. If it's a root node (columns match), load it now.
  2. If it's not a root node, check to see if its parent has been loaded yet.
  3. If its parent is there, load it.
  4. If the parent is not there, skip over it.
  5. If you've loaded this entry, remove it from your list before going on to the next entry.

Do that loop until the list of entries is empty. You can expect to loop over the list once for every generation.

  • Comment on Re: Perl modules or standard tools for searching hierachical data