The concept of looping has been essential to programming starting at the time when all programming was done at the machine language level. All higher-level languages have one or more loop statements. Some programming language experts distinguish between two types of iterative statements:
• definite iteration, and
• indefinite iteration.
In the case of indefinite iteration statements, the number of iterations is not known in advance, but is determined dynamically based on evaluation of a conditional expression either before or after every iteration. The while statement is an example of indefinite iteration. In the case of definite iteration, the number of iterations is not known explicitly by the programmer in advance. Examples of definite iterative statements in Perl are the for and foreach statements.
2.5 Iterative Statements or Loop Statements
June 16th, 2007admin