1. Perl
  2. Syntax
  3. while statement

do - while statement - Repeated processing, always executed first

You can use the do-while statement to describe iterative processing. Unlike while statement, the part described by the do block is always executed once at the beginning.

do {
  # Repeat process
}
while (condition)

do - while statement is deprecated

It is not recommended to use the do-while statement.

The first reason is that last and next are in the do block. Because it doesn't work properly. This seems to work, but it doesn't work, which can be confusing.

The second reason is that the exact same processing as the do-while statement can be described using while statement.

Related Informatrion