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

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

Thread Previous | Thread Next
Ed Avis
December 6, 2010 08:47
Re: [perl #80306] Quoting behaviour of => is too generous
Message ID:
Abigail <abigail <at>> 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 <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About