in reply to Dynamic menu generation

No, no -- I'm simply trying to generate a HTML list that retains the order it was defined in. I also cannot change the format data is received in.

Below are some examples of the array and the HTML that needs generated...

Ex1:

my @array = ( 'Main//News', 'Main//Reviews//PC', 'Main//Reviews//PS2', 'Main//Reviews//XBox', 'Other Menu//Other//Sub//Menus' );

Ex2:

my @array = ( 'Main//Reviews//PS2', 'Other Menu//Other//Sub//Menus', 'Main//Reviews//XBox', 'Main//News', 'Main//Reviews//PC' );

Ex3:

my @array = ( 'Other Menu//Other//Sub//Menus', 'Main//News', 'Main//Reviews//XBox', 'Main//Reviews//PS2', 'Main//Reviews//PC' );

--nutshell

Update 1: Didn't look at jeffa's code yet.
Update 2: Jeffa's code is almost there... it just doesn't retain the order things are defined in.
Update 3: Ok - I now know that I can't create a hash to simulate the menus tree but rather that I must use an array. I'm not sure how to do this... please help.