summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-10-09 11:06:15 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-10-09 11:06:15 +0000
commit568e6d8bd7657b48163f7ab2d0c13229c0263323 (patch)
tree0a4953215910ec912ac87f005b6ead38ad620746
parent459483364bd8ae7bd68c1206c3548757357dcc00 (diff)
downloadperl-568e6d8bd7657b48163f7ab2d0c13229c0263323.tar.gz
Document the behaviour of filetest operators regarding parentheses.
This fixes bug #24127 (by documenting it as a feature.) p4raw-id: //depot/perl@21431
-rw-r--r--pod/perlop.pod8
1 files changed, 6 insertions, 2 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod
index a50dee9d3d..081774e425 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -281,8 +281,7 @@ of bits is also undefined.
=head2 Named Unary Operators
The various named unary operators are treated as functions with one
-argument, with optional parentheses. These include the filetest
-operators, like C<-f>, C<-M>, etc. See L<perlfunc>.
+argument, with optional parentheses.
If any list operator (print(), etc.) or any unary operator (chdir(), etc.)
is followed by a left parenthesis as the next token, the operator and
@@ -307,6 +306,11 @@ but, because * is higher precedence than named operators:
rand (10) * 20; # (rand 10) * 20
rand +(10) * 20; # rand (10 * 20)
+Regarding precedence, the filetest operators, like C<-f>, C<-M>, etc. are
+treated like named unary operators, but they don't follow this functional
+parenthesis rule. That means, for example, that C<-f($file).".bak"> is
+equivalent to C<-f "$file.bak">.
+
See also L<"Terms and List Operators (Leftward)">.
=head2 Relational Operators