Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: how to get the size of a 2D array

by fenonn (Chaplain)
on Jun 29, 2001 at 16:36 UTC ( [id://92590]=note: print w/replies, xml ) Need Help??


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>

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://92590]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-28 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found