Basic HTML version of Foils prepared March 30 97

Foil 56 Additional Control Flow Constructs I (Chapter 9 of the Llama Book)

From PERL4 Tutorial for CPS616 Computational Science for Information Age Course CPS616 -- February 1995. by Geoffrey C. Fox


last, next and redo allow one simple 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
These commands control innermost enclosing for foreach or while loop
last jumps out of loop
next jumps over rest of loop
redo jumps back to start of 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 Sat Sep 6 1997