> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/perl6-rosettacode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/perl6-rosettacode/programming_tasks/l/loops/do-while.md).

# Do-while

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

`repeat ... until <i>condition</i>` is equivalent to `do ... while not <i>condition</i>`.

```perl
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.

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