Output: a=25 one=50 it looks the the += is being updated after the calculation: so (30) + (30 - 10) = 50 then after the line passes you see $a is 25. Not sure if this is how it should work or not seems kinda fishy that the += is not proccessed the same way -= is. but i still don't understand what you are trying to add up here? $result = ($a+=5) + ($a-=10); is not very intuitive. Do you expect $result to be the result status of the += or -=? I am not sure what I would even expect $result to hold += and -= are not really normal arithmatic operators...$a = 30; $one = ($a += 5) + ($a -= 10); print "a=$a one= $one \n";
In reply to Re: Re: Re: precedence question
by waswas-fng
in thread precedence question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |