good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^2: Autoincrement operator precedence difference between C and Perlby shmem (Chancellor) |
on Oct 09, 2007 at 21:49 UTC ( [id://643809]=note: print w/replies, xml ) | Need Help?? |
While your observations are most probably correct, it stands as a fact that evaluation order
of multiple pre/post-increments in one statement isn't explicitly defined in Perl 5, I guess
on purpose. It is an artifact of the implementation of Perl - it is not in the language specs
afaik - so you shouldn't rely on it, even if all perl 5 binaries we know of stack execution in
the way you describe.
And that is more than saying "while you can use multiple pre/post-increments in a single statement, it is bad practice and should be avoided" - it is saying "it's not defined. Don't". --shmem
In Section
Seekers of Perl Wisdom
|
|