The subject of autoincrement and side effects was discussed in this thread. Although we are not dealing with lvalue assignment to $i, as ariels has said, the result of the calculation is defined to be ambiguous in the C standard, and I guess the same is true of Perl. Hence you can get different results depending on platform, version and what mood the optimiser is feeling in :).