|No such thing as a small change|
Re: Operator Associative in Perlby ikegami (Pope)
|on Jun 03, 2009 at 15:37 UTC||Need Help??|
There are two major mistakes there.
While Perl doesn't document its operand evaluation order, it always evaluates operands from left to right for left-associative operators and exponentiation (**), and from right to left for assignments operators.
This case is no exception. There are two characteristics (features?) of Perl that cause the result you observe:
So, that means
is basically equivalent to
When printf gets the values from @_, it sees
C leaves the operand evaluation order up to the compiler. Results will vary from compiler to compiler. It looks like yours passed by reference, evaluating from right to left.