On Thu, 24 May 2001 22:19:12 -0400, James Mastros wrote:
>But what about: @foo[(1,2,3)]?
>
>Are those parens a list-maker, or are they a scalar expression using
>the comma operator.
Both.
But in this case, I'd say: it depends on the context the slice is called
in.
@bar = @foo[(1,2,3)];
is the same as
@bar = (@foo[1], @foo[2], @foo[3]);
or: just an ordinary slice. OTOH,
$bar = @foo[(1, 2, 3)];
is the same as
$bar = (@foo[1], @foo[2], @foo[3]);
or, the comma operator acting on the individual array items. In the
latter case, only the last array item will survive.
At least, that's what I think that should happen.
--
Bart.