Syntactic Confectionery Delight | |
PerlMonks |
Re: Why is the execution order of subexpressions undefined?by blokhead (Monsignor) |
on Apr 12, 2005 at 00:07 UTC ( [id://446801]=note: print w/replies, xml ) | Need Help?? |
It is my understanding that for the purposes of efficiency, the actual opcodes that constitute a statement like ++$i can be split up in expressions like this. Possible example: the value of $i is fetched, incremented, then other (unrelated) opcodes are done, then finally the new value is placed in $i.
The expressions that constitute the arguments are no longer atomic transactions! That would explain why in these cases you can sometimes even get behavior that differs from any execution order (at least, any that evaluates arguments atomically). I could be totally off-base here, but maybe some perlgutsgeek can authoritatively clarify the situation. blokhead
In Section
Seekers of Perl Wisdom
|
|