in reply to ... for (@_) x= 2;

I suspect the key is that x= only operates on scalars. So (@_ = ('a' .. 'b')) is in scalar context and becomes the scalar value 2 which x then make two of.

Premature optimization is the root of all job security

Replies are listed 'Best First'.
Re^2: ... for (@_) x= 2;
by LanX (Saint) on Dec 29, 2015 at 03:25 UTC
    ok but ...

    > which x then make two of.

    .. it's not an x but a combined assignment x= and it's tricky to see what exactly the target of this assignment is.

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