From: John v. V <ad...@pu...> - 2000-08-03 19:30:20
|
> > Hmm, that would only work for a HoH structure, not for an > > arbitrary structure. Frankly, I see arrays as the best way to number substructures, (and the only way to order them) but HOH is the standard for most OO languages. At least from what I read, most languages dont even give you a choice. Thats why I stick to them. I fool around with a sorta-pseudo hash made of arrays: use Loose ; #No lets see if I can remember: The first element is the list of keys, followed by the list of values, recursive. [ [ key1, key2, key3 ], val1, val2, val3... ] $x->{a} = 1 ; $x->{b} = 2 ; becomes: $x -> [ [a, b], 1, 2 ] ; $x->{c}{i} = 3 ; $x->{c}{j} = 4 ; $x-> [ [a, b, c], 1, 2, [ [ i, j ], 3, 4 ] ] ; I think... Also, is there a module out that takes all the keys from the HOH's and creates an Arr-o-Arr index. Lookups would become greps !! |