in reply to Re^6: ... for (@_) x= 2; (scalar assignment)
in thread ... for (@_) x= 2;

> It's consistent with all `OP=` operators.

You are missing the point, this sub-thread is talking about x not x=

How many operators do you know which depend on the LHS being in brackets or not?

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

Replies are listed 'Best First'.
Re^8: ... for (@_) x= 2; (scalar assignment)
by ikegami (Patriarch) on Dec 29, 2015 at 20:03 UTC

    Ah, ok.

    I know three cases where parens matter (aside from when they override precedence or disambiguate syntax):

    • (...) = ... vs ... = ...
    • (...) x ... vs ... x ...
    • eof vs eof()

    I think there's another one.

    For the first two, it was either that or create a new operator. No other operators behave differently based on whether one their operand is list-like or not. It's a pity = and x didn't adopt the same definition of list-like, but then again, one expects lvalues and the other expects rvalues.