Perl Programming/Keywords/continue

Previous: connect Keywords Next: CORE

The continue keyword edit

continue is a flow-control statement, if followed by a BLOCK. In a BLOCK or BLOCK, each time before the conditional is to be evaluated, contents of BLOCK are executed. So, it can be used to increment a loop variable even after a next statement (that resembles to the continue statement of C and other languages).

The BLOCK may contain last, next, or redo commands, where last and redo show the same behaviour as if they had been called in the main block.

Syntax edit

  continue BLOCK

Examples edit

while (EXPRESSION) {
   ### possible redo
} continue {
   ### possible next
   # go back the top to re-check the EXPRESSION
### possible last call

See also edit

Previous: connect Keywords Next: CORE