Perl do while LoopUnlike 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 syntaxThe syntax of Perl language do-while loop is given below: Flowchart of do while loopPerl do while ExampleThis is the simple program of Perl do while loop where we are printing the table of 1. Output: 1 2 3 4 5 6 7 8 9 10 Perl Nested do while Loop ExampleA 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. Example: Output: 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3 Perl Infinite do while Loop ExampleBy passing true in while condition, infinite do while loop is executed. Its execution can be stopped by using ctrl + c. Output: Infinitive While Loop Infinitive While Loop Infinitive While Loop Infinitive While Loop Infinitive While Loop ctrl+c Next TopicPerl Array |