Perl do while Loop
Unlike for and while loop, the do while loop checks its condition at the bottom of the loop. So do while loop will execute at least once.
do while loop syntax
The syntax of Perl language do-while loop is given below:
Flowchart of do while loop
Perl do while Example
This is the simple program of Perl do while loop where we are printing the table of 1.
1 2 3 4 5 6 7 8 9 10
Perl Nested do while Loop Example
A nested do while loop is the one in which a do while loop is nested inside another do while loop.
It is executed completely for both inner and outer loops.
1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3
Perl Infinite do while Loop Example
By passing true in while condition, infinite do while loop is executed. Its execution can be stopped by using ctrl + c.
Infinitive While Loop Infinitive While Loop Infinitive While Loop Infinitive While Loop Infinitive While Loop ctrl+c