Hello,

This seems possible:

    > my @x = (1, 2, 3, 4, 8, 16, 32, 64, 128);
    [1 2 3 4 8 16 32 64 128]

Then:

    > for @x -> $x, $y, $z { $x.say }
    1
    4
    32

And:

    > for @x -> $x, Any, Any { $x.say }
    1
    4
    32

...assigning to 'Any' seems to 'just work'. Assigning to 'Nil' didn't work,
however.

Is this what you are looking for?

Perhaps there's a better way for doing this? If so, I'd like to know too :)

Regards,

Raymond.

On Sat, 23 Nov 2019 at 07:00, ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> Hi All,
>
> In a "for" loop, what is the syntax for "by 3"?
>
>      for @x.lines by 3
>
> In other words, every third line.
>
> Many thanks,
> -T
>

Reply via email to