The redo statement allows you to skip
back to the beginning of the current block, without revaluation of the
control expression.
The redo statement works for the
for, foreach, while, until and naked blocks (blocks that have
put in manually that are not part of a larger block.
The redo statement does not work
for the if and do while / until
blocks.
This is just like next .
Example:
# Create an infinite loop when first odd number is entered.
while ( $nextVar = <STDIN> )
{
chomp $nextVar;
if ( ! ($nextVar % 2) )
{
redo;
}
$theSum += $nextVar;
}