Date: Fri, 15 Mar 2002 22:10:01 -0800 (PST) From: parv <parv_@yahoo.com> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/35952: perl 5 broken in 4.5 RELEASE Message-ID: <200203160610.g2G6A1Y99684@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/35952; it has been noted by GNATS.
From: parv <parv_@yahoo.com>
To: "Michael R. Wayne" <wayne@staff.msen.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/35952: perl 5 broken in 4.5 RELEASE
Date: Sat, 16 Mar 2002 01:02:59 -0500
in message <200203160432.g2G4Wiw20804@freefall.freebsd.org>,
wrote Michael R. Wayne thusly...
>
>
> >Number: 35952
> >Category: misc
> >Synopsis: perl 5 broken in 4.5 RELEASE
...
> >Description:
> This simple perl script illustrates the problem:
> #!/usr/bin/perl
> $e = 3;
> print "e: $e\n";
> ($e < 98) ? $e += 2000 : $e += 1900;
> print "e: $e\n";
from "perldoc perlop"...
Conditional Operator
...
Because this operator produces an assignable result, using
assignments without parentheses will get you in trouble.
For example, this:
$a % 2 ? $a += 10 : $a += 2
Really means this:
(($a % 2) ? ($a += 10) : $a) += 2
Rather than this:
($a % 2) ? ($a += 10) : ($a += 2)
That should probably be written more simply as:
$a += ($a % 2) ? 10 : 2;
...so you should try this...
$e += ($e < 98) ? 2000 : 1900;
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203160610.g2G6A1Y99684>
