The continue block gets executed just before the condition gets evaluated again : continue « Statement « Perl






The continue block gets executed just before the condition gets evaluated again


#while (condition) {
#  # ...
#} continue {
#  # ..
#}


#!/usr/bin/perl -w

$i = 0;

while ($i < 10) {
   print "Iteration $i.\n";

} continue {
   $i++;
}

 








Related examples in the same category

1.Example using the continue block
2.The continue block allows the while loop to act like a for loop