Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: number of rows in double dimension array

by hdb (Monsignor)
on Jul 24, 2013 at 09:50 UTC ( #1046042=note: print w/replies, xml ) Need Help??


in reply to number of rows in double dimension array

A two-dimensional array in Perl usually is an array of array references, so the number of rows is just the number of elements in the "outer" array:

my @dd = ( [ 11, 12, 13], [ 21, 22, 23], [ 31, 32, 33], [41, 42, 43], +); print "Number of rows: ", scalar @dd, "\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1046042]
help
Chatterbox?
and dust plays in a shaft of sunlight...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2018-06-19 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (111 votes). Check out past polls.

    Notices?