in reply to Re: Max dimensions of multi-dimensional array
in thread Max dimensions of multi-dimensional array

... arrays expand as needed. ... the size of your array will expand to 346 x 65536 ...

That's a bit misleading. It implies the allocation of space for a | an orthogonal multi-dimensional array of 346 * 65,536 == 22,675,456 elements. Because Perl multi-dimensional arrays are "ragged", each array "dimension" (update: maybe "vector" would be a better term here) is only allocated the space it actually needs. I count the array specified in the OPed code like this:

By my count, I get a total of 346 + 65,536 + 11 == 65,893 elements, almost all of which are undefined; the array, as it stands, is very sparse.

Update: Please see Manipulating Arrays of Arrays in Perl (perllol) and Perl Data Structures Cookbook (perldsc).


Give a man a fish:  <%-{-{-{-<