Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    my @ar1;
    ...
    $ar1[1][2] = "five";
    my $count = scalar @{ $ar1[1] };
    print "count = $count\n";
    
  2. or download this
    However, if I create the array this way it doesn't work:
    
    ...
    $ar1 = (["one", "two"], ["three", "four", "five"]);
    my $count = scalar @{ $ar1[1] };
    print "count = $count\n";