From: Jesse Vincent Date: Tue, 9 Feb 2010 15:31:16 +0000 (-0800) Subject: Document unless () {} elsif () {} else {} and tell people not to use it. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d27f8d4b40c1a3b65c4120a5d982a71f0e1f8645;p=p5sagit%2Fp5-mst-13.2.git Document unless () {} elsif () {} else {} and tell people not to use it. Note to the deprecation police: this is not a language construct deprecation. Just a bit of healthy advice about coding style. Who knows. In a decade, this may be the lynchpin of "postmodern perl". --- diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index 311be28..6359df4 100644 --- a/pod/perlsyn.pod +++ b/pod/perlsyn.pod @@ -230,6 +230,7 @@ The following compound statements may be used to control flow: if (EXPR) BLOCK elsif (EXPR) BLOCK ... else BLOCK unless (EXPR) BLOCK unless (EXPR) BLOCK else BLOCK + unless (EXPR) BLOCK elsif (EXPR) BLOCK ... else BLOCK LABEL while (EXPR) BLOCK LABEL while (EXPR) BLOCK continue BLOCK LABEL until (EXPR) BLOCK @@ -254,8 +255,11 @@ 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. In Perl even C followed -by C is valid. +the sense of the test is reversed. Like C, C can be followed +by C. C can even be followed by one or more C +statements, though you may want to think twice before using that particular +language construct, as everyone reading your code will have to think at least +twice before they can understand what's going on. The C statement executes the block as long as the expression is L.