Perl-Sensitive Sunglasses | |
PerlMonks |
Re^3: Question about returning array from subby QM (Parson) |
on Jul 10, 2015 at 13:00 UTC ( [id://1134156]=note: print w/replies, xml ) | Need Help?? |
Perl does multidimensional arrays by storing elements of the sub-array in the parent array. So
is the syntactic-sugar equivalent of
(IIRC, in Perl 4, this was the required invocation.) And the whole sub-array as
You might also think about it like this:
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
In Section
Seekers of Perl Wisdom
|
|