in reply to Dynamic menu generation
If you don't pass in a sorted array, it can create strange menus. It's also easily confused by similar leaf nodes.my @array = ( 'Main//News', 'Main//Reviews//PC', 'Main//Reviews//PS2', 'Main//Reviews//XBox', 'Other Menu//Other//Sub//Menus' ); sub menu { $_=q~;ir$w}Uw&Ii,jmcumUumbo#e_cjm>oImb}U|nyp@''@#l"ynrjmUtthU]h!U[$rhb +]h!U[11mU=mboI|_|mU#|wU"mcuL)'(*=L#/l"ynrjmU)mboI|wU"mUuhb]mU[#|wU"mc +uL)(*=)*<=hU]-s[)'*<=L#//f_y${sumc#/#tir$w~;y~L)oep<;@y>m}/Ushw![i=nb +$1*l#_&|{"]u('f,tjIcr~"<)ftI*'i_@=}s1$u#]m>lcn|Lw;obp!h[,U/jy&({re~;s +,.*,$&,ee;$_ } print menu(sort@array),$/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Dynamic menu generation
by webengr (Pilgrim) on Oct 31, 2002 at 05:32 UTC | |
by rdfield (Priest) on Oct 31, 2002 at 09:49 UTC | |
by Thelonius (Priest) on Oct 31, 2002 at 15:31 UTC | |
by tadman (Prior) on Oct 31, 2002 at 19:07 UTC |