The until statement : Until « Statement « Perl






The until statement

  

#With until, the block is repeated so long as the condition remains false. 
#You can read the command as "loop until the condition is true."
#You can reverse the while test with the until statement: 

#until (condition) {
#  # ...
#}


#!/usr/bin/perl -w

$i = 0;
until ($i >= 10) {
   print "Iteration $i.\n";

   $i++;
}

   
    
  








Related examples in the same category

1.A program that uses the until statement.
2.Average-sales problem with sentinel-controlled repetition
3.Controlling Loop Flow
4.Looping Until
5.The until Loop
6.The until modifier repeatedly executes the second expression as long as the first expression is false.
7.Use until to read user input
8.Using until with print statement
9.until statement
10.until with continue
11.until with diamond operator
12.until with integer