X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlop.pod;h=aa0e33905e5f94b5f20e8e4caadf68c129b94b26;hb=27bcc0a7e6b15b7b0d6f632d5f31918abd005ef4;hp=64206ceea8e0a653fa1788aac3b8fd08018c4ef2;hpb=b033823e2923b62e3c7a923af9208bf9b9e23040;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlop.pod b/pod/perlop.pod index 64206ce..aa0e339 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -190,8 +190,8 @@ Unary "-" performs arithmetic negation if the operand is numeric. If the operand is an identifier, a string consisting of a minus sign concatenated with the identifier is returned. Otherwise, if the string starts with a plus or minus, a string starting with the opposite sign -is returned. One effect of these rules is that C<-bareword> is equivalent -to C<"-bareword">. +is returned. One effect of these rules is that -bareword is equivalent +to "-bareword". Unary "~" performs bitwise negation, i.e., 1's complement. For example, C<0666 & ~027> is 0640. (See also L and @@ -219,7 +219,8 @@ pattern, substitution, or transliteration. The left argument is what is supposed to be searched, substituted, or transliterated instead of the default $_. When used in scalar context, the return value generally indicates the success of the operation. Behavior in list context depends on the particular -operator. See L for details. +operator. See L for details and +L for examples using these operators. If the right argument is an expression rather than a search pattern, substitution, or transliteration, it is interpreted as a search pattern at run @@ -2059,6 +2060,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