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

Another alternative to get the size of the second array would be:
$#{$array_name[2]}+1

Replies are listed 'Best First'.
Re: Re: how to get the size of a 2D array
by davorg (Chancellor) on Jun 29, 2001 at 17:09 UTC

    That only works as long as no-one has changed the value in $[. I know that no-one should be playing with that value, but it's always possible that they have.

    Why use a potentially inaccurate method, when a simpler, accurate one exists?

    --
    <http://www.dave.org.uk>

    Perl Training in the UK <http://www.iterative-software.com>