From: david nicol Date: Fri, 27 Aug 2004 21:13:42 +0000 (-0500) Subject: [perl #31228] no no-op X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd1abbef24b103836b91c31da66323dac8ca6b23;p=p5sagit%2Fp5-mst-13.2.git [perl #31228] no no-op Message-Id: 1093659222.1436.70.camel@plaza.davidnicol.com> Document that 0 and 1 can (sort of) be used as no-ops. p4raw-id: //depot/perl@23250 --- diff --git a/pod/perlop.pod b/pod/perlop.pod index 64206ce..6185c68 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -2059,6 +2059,14 @@ you say the compiler will precompute the number which that expression represents so that the interpreter won't have to. +=head2 No-ops + +Perl doesn't officially have a no-op operator, but the bare constants +C<0> and C<1> are special-cased to not produce a warning in a void +context, so you can for example safely do + + 1 while foo(); + =head2 Bitwise String Operators Bitstrings of any size may be manipulated by the bitwise operators