I would definitely go with BrowserUK's idea. Since you are numbering anyway, an array is perfect for you. Basically, the "3.1" is only important because it comes after "2.*" and before "4.*", so there's really no reason to put it in a hash, but rather an array is good.
BrowserUK: Does your example have one to many levels of anonomous arrays? I would think it would more be something like
@structure = ( { ... }, [ { ... }, { ... }, ], [ { ... }, { ... }, ], [ { ... }, { ... }, ], );
That way you can do something like:
my @structure = ( $hashref_from_first ); foreach @query { ... push @structure, [] foreach @subquery { ... push @structure->[0], $hashref; } }
Or something like that (but probably a lot better)
-Bryan
In reply to Re^2: Best complex structure?
by mrborisguy
in thread Best complex structure?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |