Why should I? Please provide a pointer to the documentation
that specifies your code is correct. In one of my other
replies I've specified a reference saying that's undefined.
Abigail | [reply] |
So you can't, okay. I know theory says it is undefined, however I have never encountered a version of Perl on any machine that did not follow that execution pattern. I can spout theoretical science which tells me that I can count on nothing I write executing as I expect -- but lucky me it usually does.
| [reply] |
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.
| [reply] |