From 2ba1f20ac3ac18b441a222cea2b0bbf6f3588c7d Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Fri, 27 Jul 2012 10:46:26 -0700 Subject: [perl #113684] Document actual prec of loop exits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These have always* had assignment precedence, such that $a = goto $b = $c is equivalent to $a = (goto ($b = $c)) * I haven’t checked before perl 5. --- pod/perlfunc.pod | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'pod/perlfunc.pod') diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 8e8bccaa25..b1cc605f3d 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -1620,6 +1620,11 @@ convert a core file into an executable. That's why you should now invoke it as C, if you don't want to be warned against a possible typo. +Unlike most named operators, this has the same precedence as assignment. +It is also exempt from the looks-like-a-function rule, so +C will cause "bar" to be part of the argument to +C. + Portability issues: L. =item each HASH @@ -2917,6 +2922,11 @@ NAME needn't be the name of a subroutine; it can be a scalar variable containing a code reference or a block that evaluates to a code reference. +Unlike most named operators, this has the same precedence as assignment. +It is also exempt from the looks-like-a-function rule, so +C will cause "bar" to be part of the argument to +C. + =item grep BLOCK LIST X @@ -3237,6 +3247,11 @@ exit out of such a block. See also L for an illustration of how C, C, and C work. +Unlike most named operators, this has the same precedence as assignment. +It is also exempt from the looks-like-a-function rule, so +C will cause "bar" to be part of the argument to +C. + =item lc EXPR X X @@ -3754,6 +3769,11 @@ that executes once. Thus C will exit such a block early. See also L for an illustration of how C, C, and C work. +Unlike most named operators, this has the same precedence as assignment. +It is also exempt from the looks-like-a-function rule, so +C will cause "bar" to be part of the argument to +C. + =item no MODULE VERSION LIST X X @@ -5568,6 +5588,11 @@ turn it into a looping construct. See also L for an illustration of how C, C, and C work. +Unlike most named operators, this has the same precedence as assignment. +It is also exempt from the looks-like-a-function rule, so +C will cause "bar" to be part of the argument to +C. + =item ref EXPR X X -- cgit v1.2.1