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