user
Start with a value at 0. Loop while value mod 6 is not equal to 0.
Each time through the loop, add 1 to the value then print it.
The loop must execute at least once.

Related tasks

* Loop over multiple arrays simultaneously
* Loops/Break
* Loops/Continue
* Loops/Do-while
* Loops/Downward for
* Loops/For
* Loops/For with a specified step
* Loops/Foreach
* Loops/Increment loop index within loop body
* Loops/Infinite
* Loops/N plus one half
* Loops/Nested
* Loops/While
* Loops/with multiple ranges
* Loops/Wrong ranges

Reference

* Do while loop Wikipedia.
assistant
(formerly Perl 6)

**Works with**: Rakudo Star version 2010.08

```
my $val = 0;
repeat {
    say ++$val;
} while $val % 6;
```

`repeat ... until condition` is equivalent to `do ... while not condition`.

```
my $val = 0;
repeat {
    say ++$val;
} until $val %% 6;
```

(Here we've used `%%`, the "divisible-by" operator.)

You can also put the condition before the block, without changing the order of evaluation.

```
my $val = 0;
repeat while $val % 6 {
    say ++$val;
}
```