So it ends when the list "(1+2)" is in. print (1+2) evaluates to 3, as shown, for example with: print print (1+2) + 4 that yields 35!!! The second question is now quite obvious too..[/spoiler]Thanks a lot, i never thought about such a use... Freddo

updated changed the font color to the new white background.

PS: Jasmine, is there a way one could set a font color in reguard to the background color (like [background]text[/background])?? ;---

I saw this post and was curious. Rather than cheat, I thought I would take a guess as to what happens in this and then test my guess later. If I didn't do this, then no one will see the point of your exercise.

So, here goes:

print (1 + 2) + 4;

In this, the (1 + 2) portion of this is the real arguments to the print function. Therefore I believe that '3' should be printed to STDOUT. Since you did not assign a variable to the return result, $_ should have the value of the returned value from print(), which if it printed is '1', plus '4', the sum of which is 5. So, if you print $_ next, it would be '5'.

Next, looking at your second example:

print (1 + 2) + (4 + 4 + (3 + 3));

I believe that '3' should be printed to STDOUT again and a print of $_ would print 15, the sum of the return value '1' + 14.

Well, RedRum, I must now shout and jump and pat myself heartily on the back. This is because I was right without cheating. I did not even see that Frodo posted a spoiler which was fixed to obscure the spoiler by Jasmine until after my post!

Your example is exactly the reason this web site needs to be here. There are always some things that will occur in programming and you will be hitting your head on the keyboard as you try to figure out why the result is not what you expected.