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

[Pugs] short-circuit operators

Thread Next
From:
Andrew Savige
Date:
March 14, 2005 20:16
Subject:
[Pugs] short-circuit operators
Message ID:
20050315041554.39867.qmail@web50806.mail.yahoo.com
The following program:

my $x = 1;
my $y = 2;
$x == 1 or $y = 42;
print"x='$x' y='$y'\n";

prints x='1' y='2' in perl5, but prints x='1' y='42' in pugs.

(I'm having a go at rewriting a small p5 script in p6 and finding out,
by trial and error, what seems to work in Pugs and what doesn't).

Oh, and should I add:

use v6;

at the top of my Pugs .p6 scripts? (I have no idea what that does,
just noticed it in some other example scripts).

Thanks,
/-\


Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

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