Help for this page

Select Code to Download


  1. or download this
    my @a = ( 3, 1, 4, 1, 5 );
    my $N = @a;
    ...
    my $aref = \@a;
    $refsize = @$aref; # or @{$aref};
    say $refsize;
    
  2. or download this
    my @twoD = ( [ 1, 2, 3 ],
                 [ 4, 5, 6 ],
    ...
    for my $row ( @twoD ) {
       print "row has " . scalar @$row . " elements\n";
    }