Until loop in Perl with example

Until loop behaves just opposite to the while loop in perl, while loop continues execution as long as the condition is true. In until loop, the loop executes as long as the condition is false.

Syntax of until loop:

until(condition)
{
statement(s);
}

Flow of Execution of the until Loop

The condition is evaluated first, if it returns false, the statements inside loop gets executed. After execution the condition is re-evaluated. This goes on until the condition returns true. Once the condition returns true, the control gets transferred to the next statement after until loop.