Perl does multidimensional arrays by storing elements of the sub-array in the parent array. So
$x[0][1] = 12;
is the syntactic-sugar equivalent of
$x[0]->[1] = 12;
(IIRC, in Perl 4, this was the required invocation.)
And the whole sub-array as
$x[0] = \@subarray;
You might also think about it like this:
@x = ( ["some", "sub", "array"], ["next", "sub", "array] );
which is making anonymous arrays, and assigning the lot to @x. And these can be nested as deeply as you have memory for (AFAIK, but that would be a good exercise to check).
Update:
Yes, it seems that simply nesting empty arrays keeps going until it runs out of memory, starts swapping, and in my case, is killed by the OS.
-QM
--
Quantum Mechanics: The dreams stuff is made of
|