Using both next and continue : Next « Statement « Perl






Using both next and continue

  

while ($loop_index <= 10) {
    print "Hello\n";
    next if $loop_index > 5;
    print "there\n";
} continue {
    $loop_index++;
}

   
    
  








Related examples in the same category

1.Using the next statement in a foreach structure.
2.Next statement
3.Next if
4.Going onto the Next
5.A word-counting program that uses the next statement.
6.next with condition
7.Next statement with if statement