Help for this page

Select Code to Download


  1. or download this
    my @arr = ([1,1], [2,2], [3,3]);
    #  [[1, 1], [2, 2], [3, 3]]
    
    $_->[2] = $i++ for @arr;
    #  [[1, 1, 0], [2, 2, 1], [3, 3, 2]]
    
  2. or download this
    $_->[$#{$_}+1] = $i++ for @arr;
    #  or
    push @{$_}, $i++ for @arr;