It works, but you'll have to be careful about how you copy it. Perl Monks inserts red plus signs (+) to break up the lines, that if pasted in to the program will cause it to fail. You can edit these out if you're careful, and join the program back in to one line, or use the "D/L Code" link to get a clean copy.

Now, this is intentionally obfuscated, but the non-obfuscated source isn't that much clearer. Here's the encoded program that is being run:
*menu=sub{my(@r,@s,@c);for(@_){@c=split'//';while(@s&&$s[$#s]ne$c[$#s]||@s>@c){pop@s;push@r,"</UL>";}while(@s<@c){push@s,$c[@s];push@r,"<UL><LI>$s[-1]</LI>";}}join!1,@r;};&menu

In reply to Re^3: Dynamic menu generation by tadman
in thread Dynamic menu generation by nutshell

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.