From: Robin Houston <[EMAIL PROTECTED]>
Date: 9/21/01 11:40:41 AM
> What's the other erroneous answer? Is it to confuse lists
> with arrays _and_ to get the precendence muddled, so that
> you not only believe that statements parses as C<$i =(1,
> 2)> but also believe that the value of $i will thereby
> come to be the length of the list on the RHS?
Hmmm... haven't heard that interpretation yet.
> If that's it, the question could be C<$i=1,3> so that the
> different interpretations would all result in different
> outcomes.
True. And something to bear in mind when using the question in
interviews :)
No, the "stage 1" reasoning that I refered to was that $i is
equal to 1 because the comma operator returns its left-hand operand.
This gives the right answer for the wrong reason.
Dave...
--
<http://www.dave.org.uk>
Mention The Lord of the Rings just once more and I'll more than
likely kill you,
"Moorcock! Moorcock! Michael Moorcock!" you fervently moan.
- Half Man Half Biscuit (Dickie Davies Eyes)