develooper Front page | perl.perl6.compiler | Postings from April 2005

[pugs]weird thing with say ++$

Thread Next
From:
fayland
Date:
April 21, 2005 01:48
Subject:
[pugs]weird thing with say ++$
Message ID:
20050421083227.27464.qmail@lists.develooper.com
It has been published at perl6.language, but have no reply.

In perl v5.8.6 built for MSWin32-x86-multi-thread:

my $i = 1;
print $i++, ++$i; # 1 3
my $i = 1;
print ++$i, $i++; # 3 2

in pugs:

my $i = 1;
say $i++, ++$i; # 1 3

my $i = 1;
say ++$i, $i++; # 2 2

which is right?(I think perl5 is) or it's different between Perl5 and Perl6?

thanks.

/Fayland Lam/
--------------
http://www.fayland.org



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About