Given my explanation of the problem, the workaround would be to convert the lvalue returns by the pre-increment operator into rvalues.
>perl -E"say ++$i,++$i;" 22 >perl -E"say 0+(++$i),0+(++$i);" 12
Technically, the operand evaluation order for the comma operator in list context is not defined, but it's not likely to ever change, especially since the operand evaluation order for the comma operator in scalar context is defined.
In reply to Re: Pre vs Post Incrementing variables
by ikegami
in thread Pre vs Post Incrementing variables
by SavannahLion
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |