From owner-freebsd-bugs Fri Mar 15 22:10:10 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E3E8837B405 for ; Fri, 15 Mar 2002 22:10:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2G6A1Y99684; Fri, 15 Mar 2002 22:10:01 -0800 (PST) (envelope-from gnats) Date: Fri, 15 Mar 2002 22:10:01 -0800 (PST) Message-Id: <200203160610.g2G6A1Y99684@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: parv Subject: Re: misc/35952: perl 5 broken in 4.5 RELEASE Reply-To: parv Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR misc/35952; it has been noted by GNATS. From: parv To: "Michael R. Wayne" 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