develooper Front page | perl.perl5.porters | Postings from December 2010

Re: [perl #80306] Quoting behaviour of => is too generous

Thread Previous | Thread Next
From:
Ed Avis
Date:
December 6, 2010 08:47
Subject:
Re: [perl #80306] Quoting behaviour of => is too generous
Message ID:
loom.20101206T174332-339@post.gmane.org
Abigail <abigail <at> abigail.be> writes:

>I don't think we should have had => bind more tightly than binary
>arithmetic operators. And I certainly don't think we should change this.

Agreed, I do not suggest a change to how tightly it binds, but rather that the
binding and quoting behaviour should be consistent.  At the moment we have
'tight binding' for the magic quoting effect, so that in

    12 -aa => 1

it is the 'aa' that is a candidate for magic quoting, not '-aa' or '12 -aa'.
But given that => as an operator binds more loosely than -, the quoting should
follow the same rule, so that for quoting purposes as well as for evaluation
order the LHS of => is (12 -aa).

That would then give a syntax error because of the bareword 'aa', which is the
least surprising behaviour IMHO.

-- 
Ed Avis <eda@waniasset.com>


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About