Hi All- I have the following problem. A top level directory /clients and there are a number of directories beneath (and further subdirectories) I need to produces the following HTML:
<ul class="navigation-explorer"> <li><div class="icon" id="menu/menuitem[0]"><a class="navigatio +n-node" href="#" onclick="top.customnavhandler('menu/menuitem[0]'); r +eturn false;">Business</a></div></li> <div class="navigation-layer"> <ul class="navigation-explorer"> <li><div class="icon" id="menu/menuitem[0]/menuitem[0]"> +<a class="navigation-node" href="#" onclick="top.customnavhandler('me +nu/menuitem[0]/menuitem[0]'); return false;">Small Business</a></div> +</li> <div class="navigation-layer"> <ul class="navigation-explorer"> <li><div class="icon" id="menu/menuitem[0]/menuit +em[0]/menuitem[0]"><a class="navigation-node" href="#" onclick="top.c +ustomnavhandler('menu/menuitem[0]/menuitem[0]/menuitem[0]'); return f +alse;">Products & Services</a></div></li> <li><div class="icon" id="menu/menuitem[0]/menuit +em[0]/menuitem[1]"><a class="navigation-node" href="#" onclick="top.c +ustomnavhandler('menu/menuitem[0]/menuitem[0]/menuitem[1]'); return f +alse;">Solutions</a></div></li> <li><div class="icon" id="menu/menuitem[0]/menuit +em[0]/menuitem[2]"><a class="navigation-node" href="#" onclick="top.c +ustomnavhandler('menu/menuitem[0]/menuitem[0]/menuitem[2]'); return f +alse;">Wireless</a></div></li> <div class="navigation-layer"> <ul class="navigation-explorer"> <li><div class="icon" id="menu/menui +tem[0]/menuitem[0]/menuitem[2]/menuitem[0]"><a class="navigation-node +" href="#" onclick="top.customnavhandler('menu/menuitem[0]/menuitem[0 +]/menuitem[2]/menuitem[0]'); return false;">Phones</a></div></li> </ul> </div> </ul> </div> </ul> </div> </ul>
I was hoping there is a quick Perl script that will recurse through these directories and be able to dynamically determine the depth and produce the required levels. Each lower level requires the fullpath of it's parents, and there is an XML file in each folder with some more information to be parsed. I think I can figure that one out once the recursion code is working. Might anyone be able to shed some light on this one? Thanks a bunch!!!

In reply to Dynamic list of HTML by LPC2010

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.