in reply to Re^2: Operator overloading with returning lists?
in thread Operator overloading with returning lists?
That's not all I said. I immediately followed it (not even stopping to start a new sentence) withx behaves different in list context as wellNot a very good example. It's more the LHS operand than the context which determines what is returned.
but only if its LHS has parens, making it an odd oneBoth context and the LHS matter, just as I said:
my $w = 'x' x 5; say "$w"; # Scalar context, no parens. my $x = ('x') x 5; say "$x"; # Scalar context, parens. my @y = 'x' x 5; say "@y"; # List context, no parens. my @z = ('x') x 5; say "@z"; # List context, parens. __END__ xxxxx xxxxx xxxxx x x x x x
|
|---|