Help for this page

Select Code to Download


  1. or download this
    @copy = @$r;
    while (my @pair = splice @copy, 0, 2) {
      push @$r2, [@pair];
    }
    
  2. or download this
    @copy = @$r;
    # I guess you know that your array will work for this, but
    ...
                    # next if $_%n
      push @$r2, [$copy[$_],$copy[$_+1]];
    }