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

the documentation says that x can only act like a list repeater in list context.

> > In list context, if the left operand is enclosed in parentheses or is a list formed by qw/STRING/, it repeats the list.

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

  • Comment on Re^3: ... for (@_) x= 2; (scalar assignment)

Replies are listed 'Best First'.
Re^4: ... for (@_) x= 2; (scalar assignment)
by rsFalse (Chaplain) on Dec 29, 2015 at 14:38 UTC
    Thanks :) . Now I catched it!
      It's one of these DWIM edge case implementations which make Perl less orthogonal. :-/

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

        It's not an edge case. It's consistent with all `OP=` operators.

        The reason is simple: You can't evaluate an expression as a boolean and as a list.