in reply to Re^2: List assignment in scalar context
in thread List assignment in scalar context
You tricked yourself.
In the first case, the list assignment is evaluated in scalar context. In the second case, the list assignment is evaluated in list context and assigned to @x, yielding an array with three elements, which is then evaluated in scalar context. And an array with three elements evaluates to 3 in scalar context.
Makeshifts last the longest.
|
|---|