The trick is to realise that there is no such thing as a 2D array in Perl. It's actually an array where the elements are references to a other arrays. Therefore $array_name[2] contains the reference to the array and @{$array_name[2]} gives you the referenced array. To get the size of this array simply evaluate it in a scalar context as always.
$size = @{$array_name[2]};
You might like to take a look at the perlreftut, perllol and perldsc manual pages for more information.
--Perl Training in the UK <http://www.iterative-software.com>
In reply to Re: how to get the size of a 2D array
by davorg
in thread how to get the size of a 2D array
by richmusk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |