Help for this page

Select Code to Download


  1. or download this
    while (@a) {
       my @group = splice(@a, 0, 3);
       ...
    }
    
  2. or download this
    for my $i (0..@a/3-1) {
       my @group = @a[$i*3..$i*3+2];
       ...
    }
    
  3. or download this
    for (my $i=0; $i<@a; $i+=3) {
       my @group = @a[$i..$i+2];
       ...
    }
    
  4. or download this
    use List::MoreUtils qw( natatime );
    
    ...
    while (my @group = $it->()) {
       ...
    }