 
 
 
 
 
   
The while statement is as follows:
while (expression)
  { # while expression is true execute this block
      statement(s);
  }
For example:
i = 1;
while (  $i <= 10 )
  { # count to 10
     print "$i\n";
     ++$i;
  }
The until statement says do while expression is false as declared is as follows:
until (expression)
  { # until expression is false execute this block
      statement(s);
  }
For example:
i = 1;
until (  $i > 10 )
  { # count to 10
     print "$i\n";
     ++$i;
  }