in reply to order of arguments evaluated

There seems to have been a lot of erroneous information given out in the various replies above. It just so happens that the args are evaluated left-to-right, but since the first arg is a pass-by-reference of $var, it gets modified by the subsequent ++; it's a bit like
$ perl -le'sub f {$var++; print $_[0]} f $var' 1 $

Dave.

Replies are listed 'Best First'.
Re^2: order of arguments evaluated
by ivancho (Hermit) on May 17, 2005 at 11:27 UTC
    this, I must say, is a marvelous turn of events. I'm almost glad I gave the bad advice, just for learning the above.

    ie, since ',' always evaluates its left argument first and is listed as left-associative, this means Perl would definitely process every argument list left-to-right?
    And also, $var++ is passed by value, while ++$var is passed by reference, so print($var++,++$var,$var++) would print 143...
    truly magnificent, albeit mildly confusing..

    In any case, thanks for the correction, Dave