in reply to Re: Best complex structure?
in thread Best complex structure?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Best complex structure?
by BrowserUk (Patriarch) on Jun 08, 2005 at 18:25 UTC | |
by Anonymous Monk on Jun 09, 2005 at 15:09 UTC | |
by BrowserUk (Patriarch) on Jun 09, 2005 at 15:26 UTC | |
by mat21 (Beadle) on Jun 09, 2005 at 17:47 UTC | |
by BrowserUk (Patriarch) on Jun 09, 2005 at 15:36 UTC | |
by mat21 (Beadle) on Jun 09, 2005 at 18:19 UTC | |
by BrowserUk (Patriarch) on Jun 09, 2005 at 18:59 UTC | |
|