in reply to Re: Is this a bug, or expected behavior?
in thread Is this a bug, or expected behavior?

I would expect $a->[1, 2, 3, 4] to be the same as $a->[4], because the index is being evaluated in a scalar context, which means the comma is a "comma operator" (evaluate left expression, discard it, evaluate right expression). Correct?

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^3: Is this a bug, or expected behavior?
by QM (Parson) on Mar 19, 2006 at 17:25 UTC
    Yes, rigthly so.

    When I first checked this, I must have made a mistake, because it behaves exactly as you indicate.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of