On Mon, Nov 25, 2002 at 09:16:10PM -0000, [EMAIL PROTECTED] wrote: > > Can anyone explain why these print different output? > > my ($x,$y); > print $x++ , ++$x , $x++ ,"\n"; # prints 032 > print $y++ . ++$y . $y++ ,"\n"; # prints 022
Because the behaviour is documented as being UNDEFINED. From the manual
page:
"++" and "--" work as in C.
And in C, the behaviour is undefined. For all you know, pink monkeys
may fly out of your nose if you do things like this.
Abigail
