Laurent_R, for 1 level it is rather easy to use list.
list($tab, $type, [$value1, $value2]);
Now if either of those have a list too, it starts to get complicated.
list($tab, $type, [ [$value1, { inlist => [ $inlist1_type, [ $value1a, $value1b ] ], cla +ss => $value1class }], [$value2, { inlist => [ $inlist2_type, [ $value2a, $value2b ] ]}], ]);
And if it goes deeper.
list($tab, $type, [ [$value1, { inlist => [ $inlist1_type, [ $value1a, $value1b ] ], cla +ss => $value1class }], [$value2, { inlist => [ $inlist2_type, [ [$value2a, { inlist => [ $inlist2a_type, [$value2a1, $value2a2 ] ] +}], [$value2b, { style => 'font-size: small' }] ]]}], ]);
A lot more than the inner lists goes into the hash refs: class, id, style, lang, various javascript attributes. For list items there is also value, so if $value2's inlist were an ordered list (but not starting at 1), I would do the following, and will have to for some lists...
list($tab, $type, [ [$value1, { inlist => [ $inlist1_type, [ $value1a, $value1b ] ], cla +ss => $value1class }], [$value2, { inlist => [ $inlist2_type, [ [$value2a, { inlist => [ 'o', [ [$value2a1, { value => '2' }], $value2a2 ]]}], [$value2b, { style => 'font-size: small' }] ]]}], ]);
For example, I own books 2-5 of Bio of a Space Tyrant by Piers Anthony, so I would like to write the data like...
#2 Mercenary # Politican # Executive # Statesman
For for another series of novels, it is even odder.
#41 The Soldier's of Fear #47 Q-Space
Writing the subroutines to make HTML lists was kind of fun, but it is a lot of work to use it.
In reply to Re^2: Need help with filling a complicated data structure
by Lady_Aleena
in thread Need help with filling a complicated data structure
by Lady_Aleena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |