Transcription of Control Structures in Perl
{{id}} {{{paragraph}}}
Copyright 2006 Stewart WeissCopyright 2009 Stewart WeissControl Structures in PerlControl Structures in PerlControlling the Execution Flow in a Program2 CSci 132 Practical UNIX with PerlControl flow in programsA program is a collection of statements. After the program executes one statement, it "moves" to the next statement and executes that one. If you imagine that a statement is a stepping stone, then you can also think of the execution flow of the program as a sequence of "stones" connected by arrows:statementstatement3 CSci 132 Practical UNIX with PerlSequencesWhen one statement physically follows another in a program, as in $number1 = <STDIN>;$number2 = <STDIN>;$sum = $number1 + $number2; the execution flow is a simple sequence from one statement to the next, without choices along the way. Usually the diagrams use rectangles to represent the statements:stmt 1stmt 2stmt 34 CSci 132 Practical UNIX with PerlAlteration of flowSome statements alter the sequential flow of the program.
Control Structures in Perl Controlling the Execution Flow in a Program. 2 CSci 132 Practical UNIX with Perl Control flow in programs A program is a collection of statements. After the program executes one statement, it "moves" to the next statement and executes that one. If you imagine that a statement is a
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}