in reply to Friday Code Quiz

I'm reckoning it's the comma operater, evaluating left to right and returning the last value evaluated (very handy in for loops in C). Or I could be wrong...

broquaint

Update: bah humbug running the code first! That's like looking at the answers in the back of the book then trying to explain why they work (unless of course you know ;o)

Replies are listed 'Best First'.
Re: Re: Friday Code Quiz
by davorg (Chancellor) on Sep 21, 2001 at 15:50 UTC

    But the last value evaluated would be 2. And $i is set to 1.

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you don't talk about Perl club."