Context affects what operators return.
@arr = ("a", "b", "c");
This is a list assignment operator because left-hand side of the =
"looks listy". The list assignment operator evaluates its right-hand side in list context.
The comma operator in list context evaluates each operand in list context, and produces the all the scalars produced by its operands.
$a = @arr;
This is a scalar assignment operator because left-hand side of the =
"doesn't look listy". The scalar assignment operator evaluates its right-hand side in scalar context.
An array in scalar context produces the number of elements in the array.
$a = ("a", "b", "c");
This is a scalar assignment operator because left-hand side of the =
"doesn't look listy". The scalar assignment operator evaluates its right-hand side in scalar context.
The comma operator in scalar context evaluates all but the last operand in void context, then it evaluates the last operand in scalar context. It produces the scalar produced by this last operand.
This means that
EXPR, EXPR2, EXPR3 # In scalar context
is similar to
do { EXPR; EXPR2; EXPR3 } # In scalar context
(Just no lexical scope.)
Ref: