Building a tree of files

Andy Wardley abw at
Wed Mar 1 18:06:13 GMT 2006

Can anyone point me to the right module, appropriate rules for 
File::Find::Rule, or any other clues to achieve the following?

I'm building HTML pages for a set of modules.  I want a nice nested
menu which I can easily generate via TT given the appropriate data 

Something like this would do me very nicely:

$tree = [
    {  name = ''
       path = ''
       type = 'file',
    {  name = 'Foo',
       type = 'directory',
       tree = [
         { name = ''
           path = 'Foo/'
           type = 'file'
         # ...etc...
    # ...etc..

Ideally I would like the or Foo.pod (or presumably some
other file spec of my choosing) to appear in the tree immediately
before the directory of the same name.  My resulting menu should
look like this:
     # ...etc...

I've got my own hacked-up code built from File::Find::Rule which
nearly works, but it's getting messy and I'm sure I'm missing
some nice elegant solution.  So before I hack it around to
make/break it better/worse I thought I'd ask to see if someone
else has any pointers.


PS Buffy, Pie, Pony

More information about the mailing list