From: Reini Urban Date: Tue, 9 Feb 2010 15:17:00 +0000 (-0800) Subject: "unless else" wasn't previously documented, though it was valid syntax X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=62d98eed78990cd89aa439f636585f5dec67b0cd;p=p5sagit%2Fp5-mst-13.2.git "unless else" wasn't previously documented, though it was valid syntax --- diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index 4e1bc0a..311be28 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 statement is straightforward. Because BLOCKs are always bounded by curly brackets, there is never any ambiguity about which C an C goes with. If you use C in place of C, -the sense of the test is reversed. +the sense of the test is reversed. In Perl even C followed +by C is valid. The C statement executes the block as long as the expression is L.