Time to whip out the manual!
Note that just as in C, Perl doesn't define when the variable is incremented or decremented. You just know it will be done sometime before or after the value is returned. This also means that modifying a variable twice in the same statement will lead to undefined behaviour. Avoid statements like:You're doing just that. You do something that is documented to not guarantee what the result is.Perl will not guarantee what the result of the above statements is.$i = $i ++; print ++ $i + $i ++;
It's fine if you go that way. Just don't ask why you're getting the results you're getting.
In reply to Re: Order of evaluation/interpolation of references
by JavaFan
in thread Order of evaluation/interpolation of references
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |