while ( EXPRESSION ) { STATEMENTS; }Note that the DO is implied. If the condition is initially false, the body of the loop will never execute. In the next form, the loop will execute at least once.
do { STATEMENTS; } while (EXPRESSION);All loops support the following two control statements:
# one way to count to 10 $number = 0; while(1) { $number++; if ($number >= 10 ) { last; } }
The National Center for Supercomputing Applications
University of Illinois at Urbana-Champaign
johnsonb@ncsa.uiuc.edu
Last modified: June 19, 1997