in reply to determining length of multidimensional arrays

Or you can just access the length of the array directly instead of forcing it with scalar context, though this admittedly does return n - 1 instead of n, due to Perlish oddness.
my @arr = (0,1,2); my @nested = (3,4,\@arr); print $#{$nested[2]};

Replies are listed 'Best First'.
Re^2: determining length of multidimensional arrays
by GrandFather (Saint) on Apr 02, 2006 at 00:50 UTC

    Or also due to the same Perl oddness OP could:

    my @arr = (0,1,2); my @nested = (3,4,\@arr); print scalar @{$nested[2]};

    Prints:

    3

    DWIM is Perl's answer to Gödel