--- Ingo Blechschmidt wrote:
> Andrew Savige wrote:
>> The following program:
>>
>> my $x = 1;
>> my $y = 2;
>> $x == 1 or $y = 42;
> ^ typo?
No, it's not a typo. I was (perhaps not very clearly) trying to
demonstrate that the short-circuiting operators, namely:
or and && ||
are not short-circuiting in Pugs, at least that's what I see.
I am assuming that the above test program is valid in p5 and p6,
and with the same semantics -- if I'm mistaken, please let me know.
Here is a similar test program for the 'and' operator:
my $x = 1;
my $y = 2;
$x == 3 and $y = 42;
print"x='$x' y='$y'\n";
which again produces different results with p5 and pugs.
BTW, the program I'm trying to convert, often does things like:
open(...) or die "...";
/-\
Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com
Thread Previous
|
Thread Next