diff options
author | Reini Urban <rurban@x-ray.at> | 2010-02-09 07:17:00 -0800 |
---|---|---|
committer | Jesse Vincent <jesse@bestpractical.com> | 2010-02-09 07:17:00 -0800 |
commit | 62d98eed78990cd89aa439f636585f5dec67b0cd (patch) | |
tree | ddfc35b22848b8b10f647e38a3b22b026def7270 /pod/perlsyn.pod | |
parent | dc08a87be50ba933831af3060c5255da6ce8dea3 (diff) | |
download | perl-62d98eed78990cd89aa439f636585f5dec67b0cd.tar.gz |
"unless else" wasn't previously documented, though it was valid syntax
Diffstat (limited to 'pod/perlsyn.pod')
-rw-r--r-- | pod/perlsyn.pod | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index 4e1bc0a8a7..311be28962 100644 --- a/pod/perlsyn.pod +++ b/pod/perlsyn.pod @@ -228,6 +228,8 @@ The following compound statements may be used to control flow: if (EXPR) BLOCK if (EXPR) BLOCK else BLOCK if (EXPR) BLOCK elsif (EXPR) BLOCK ... else BLOCK + unless (EXPR) BLOCK + unless (EXPR) BLOCK else BLOCK LABEL while (EXPR) BLOCK LABEL while (EXPR) BLOCK continue BLOCK LABEL until (EXPR) BLOCK @@ -252,7 +254,8 @@ all do the same thing: The C<if> statement is straightforward. Because BLOCKs are always bounded by curly brackets, there is never any ambiguity about which C<if> an C<else> goes with. If you use C<unless> in place of C<if>, -the sense of the test is reversed. +the sense of the test is reversed. In Perl even C<unless> followed +by C<else> is valid. The C<while> statement executes the block as long as the expression is L<true|/"Truth and Falsehood">. |