in reply to number of rows in double dimension array
That would depend on how you arrange the rows and columns in your array; however, if you use (what I'd consider) the normal way, then @double_dimension_array in scalar context will return the number of rows. Furthermore, assuming a gridded or table structure, where each row has the same number of columns, @{ $double_dimension_array[0] } in scalar context will return the number of columns.
$ perl -Mstrict -Mwarnings -E ' my @dd = ( [ qw{ r0c0 r0c1 r0c2 } ], [ qw{ r1c0 r1c1 r1c2 } ], ); my $number_of_rows = @dd; say "No. of rows: $number_of_rows"; my $number_of_columns = @{ $dd[0] }; say "No. of columns: $number_of_columns"; ' No. of rows: 2 No. of columns: 3
-- Ken
|
|---|