# Perl 5 my $is_ok = 1; for my $t (0 .. 6) { if (abs($new[$t]-$new[$t+1]) > 3) { $is_ok = 0; last; } } if ($is_ok) { push @moves, [$i,$j]; } # Perl 6 my $is_ok = 1; for 0..6 -> $t { if abs(@new[$t] - @new[$t+1]) > 3 { $is_ok = 0; last; } } if $is_ok { push @moves: [$i, $j]; }