in reply to how to get the size of a 2D array

... and if you want the total number of elements in a 2d array:
use List::Util qw/sum/; my $num = sum map scalar @{$_}, @array;


ar0n ]

Replies are listed 'Best First'.
Re: (ar0n) Re: how to get the size of a 2D array
by agoth (Chaplain) on Jun 29, 2001 at 19:45 UTC
    i like it, or:
    $num += scalar @{$_} for @array;
    :)