You have not yet encountered a perl that didn't execute
it in this way. You have been lucky in that all perls to date
have happened to execute it in one particular order.
Abigail has repeatedly pointed out with references to the
documentation that the behavior is officially undefined. What would happen if a hypothetical JPerl reimplemented perl (as currently documented) in Java, but it chose a different behavior for postincrement? Oops, your code won't work because of an incorrect assumption about how postincrement
will behave.
Granted this is a hypothetical. But it remains the case that relying on undefined behavior is a sloppy practice and
probably bound to eventually screw you over.
|