Basic HTML version of Foils prepared
Sept 20 97
Foil 27 Control Structures --
while,until Statements
From
Tutorial on PERL Computational Science for Information Age Course CPS616 --
Sept 20 97
.
by
Geoffrey C. Fox,Nancy McCracken,Tom Scavo
1
The simplest iterations are while and until
2
while ( TESTEXPRESSION ) {
some statement block; # if TESTEXPRESSION true
3
}
4
For example:
5
while ( <STDIN> ) {
Process Current Input line; # until EOF in <STDIN>
6
}
7
Conversly we can wait for a signal to stop:
8
until ( TESTEXPRESSION ) {
some statement block; # if TESTEXPRESSION false
9
}
in Table To:
©
Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu
If you have any comments about this server, send e-mail to
webmaster@npac.syr.edu
.
Page produced by
wwwfoil
on Sun Sep 21 1997