Hi all!
Maybe this has been answered before, but my searching didn't show up
anything: The Perl Book says: Auto increment and decrement work as in C.
So if I take this C program:
#include <stdio.h>
#include <stddef.h>
int main() {
int a;
int b;
a=3;
b=(++a)+(a++);
printf("b=%d\n",b);
}
it prints b=8.
When I do the same in perl:
$a = 3;
$b = (++$a) + ($a++);
print "b=$b\n";
It prints b=9.
I checked with a friend and Java behaves like C and prints 8.
Can someone enlighten us by giving an interpretation of the above term?
Thanks a lot and all the best
Norbert
------------------------------------------------------------------------
Dr. Norbert Preining <[EMAIL PROTECTED]> Università di Siena
Debian Developer <[EMAIL PROTECTED]> Debian TeX Group
gpg DSA: 0x09C5B094
fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>