summaryrefslogtreecommitdiff
path: root/pod/perlop.pod
diff options
context:
space:
mode:
authordavid nicol <whatever@davidnicol.com>2004-08-27 16:13:42 -0500
committerDave Mitchell <davem@fdisolutions.com>2004-09-01 20:46:13 +0000
commitfd1abbef24b103836b91c31da66323dac8ca6b23 (patch)
tree54367f1aa8dd0aca4f89f3a69f9078e7fd98759d /pod/perlop.pod
parentd4797c1db270629c34a4328ed9f62ec5d7a6003c (diff)
downloadperl-fd1abbef24b103836b91c31da66323dac8ca6b23.tar.gz
[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
Diffstat (limited to 'pod/perlop.pod')
-rw-r--r--pod/perlop.pod8
1 files changed, 8 insertions, 0 deletions
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