From fd1abbef24b103836b91c31da66323dac8ca6b23 Mon Sep 17 00:00:00 2001 From: david nicol Date: Fri, 27 Aug 2004 16:13:42 -0500 Subject: [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 --- pod/perlop.pod | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pod/perlop.pod') diff --git a/pod/perlop.pod b/pod/perlop.pod index 64206ceea8..6185c686e0 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 -- cgit v1.2.1