[Brisbane-pm] Counting elements in a 2D array

Martin Jacobs martin_jacobs at optusnet.com.au
Thu Mar 1 19:44:05 PST 2007


Hi folks,

How do I count the number of elements in a 2D array.

I have an array called @rainrecord, which has a number of elements  
$rainrecord[x][y].

If I do

$Last_line_in_Rainfall_data_array = $#rainrecord;

It returns '7'. It looks to me that this is the number of 'x' entries  
- 'x' goes from 0 to 7, whereas 'y' could be anything.

How do I get it to return the number of 'y' entries?

Again, thanks in advance.

Regards,
Martin
Visit my website...
http://web.mac.com/martin_jacobs1

PS I have the book Programming Perl, and I've looked it up in  
PerlDoc, but I still don't get it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/brisbane-pm/attachments/20070302/f03f176a/attachment.html 


More information about the Brisbane-pm mailing list