Basic HTML version of Foils prepared Sept 20 97

Foil 59 Additional Control Flow Constructs I

From Tutorial on PERL Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


last, next and redo provide ways to alter execution flow in loops:
while (something is tested) {
  • # redo goes to here
  • somecalc1;
  • if (somecondition) {
    • somecalc2;
  • }
  • somecalc3;
  • #next goes to here
}
# last jumps to here
last jumps out of loop
next jumps over rest of loop
redo jumps back to start of loop
These commands control innermost enclosing for, foreach, or while loop



© 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