Do the parentheses around $x do anything?
Yes, they make a single-element list.
It seems to me that the rhs will always be a scalar...
It will, because the high-precedence or operator (||) imposes scalar context on its operands and evaluates to a scalar.
Consider, however, the difference between:
my $x = @some_array; my ($y) = @some_array;
The lvalue parentheses are significant.
In reply to Re: list context
by chromatic
in thread list context
by 7stud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |