Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Why is the execution order of subexpressions undefined?

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

  • Comment on Re: Why is the execution order of subexpressions undefined?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://446801]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-19 04:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found