[prev] [index] [next]

Control Structures

All single Perl statements must be terminated by a semicolon, e.g.

$x = 1;
print "Hello";

All statements with control structures must be enclosed in braces, e.g.

if ($x > 9999) {
    print "x is big\n";
}

You don't need a semicolon after a statement group in {...}.

Statement blocks can also be used like anonymous functions.