How to be aware of missing values during multi-value iteration in Perl 6?

Viewed 172

During multi-value iteration, if we run out of values, the last group of values will not be handled in the current version of Rakudo.

my @arr = 1, 2, 3, 4, 5, 6
for @arr -> $a, $b, $c, $d {
  say $a
  say $b
  say $c
  say $d
}

The result is

1
2
3
4

, which drops 5 and 6.

So in which way I am able get the elements that are dropped?

2 Answers
Related