From nobody@FreeBSD.org  Fri Mar 15 20:33:19 2002
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 3AE8A37B483
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 15 Mar 2002 20:32:44 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id g2G4Wiw20804;
	Fri, 15 Mar 2002 20:32:44 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200203160432.g2G4Wiw20804@freefall.freebsd.org>
Date: Fri, 15 Mar 2002 20:32:44 -0800 (PST)
From: "Michael R. Wayne" <wayne@staff.msen.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: perl 5 broken in 4.5 RELEASE
X-Send-Pr-Version: www-1.0

>Number:         35952
>Category:       misc
>Synopsis:       perl 5 broken in 4.5 RELEASE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 15 20:40:01 PST 2002
>Closed-Date:    Sat Mar 16 11:46:15 PST 2002
>Last-Modified:  Sat Mar 16 11:46:15 PST 2002
>Originator:     Michael R. Wayne
>Release:        4.5 RELEASE
>Organization:
Msen, Inc.
>Environment:
FreeBSD vault.msen.com 4.5-RELEASE-p2 FreeBSD 4.5-RELEASE-p2 #4: Fri Mar  8 16:32:47 EST 2002     root@stats2.msen.com:/usr/obj/usr/src/sys/GENERICkbd  i386   
>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";




>How-To-Repeat:
See above.
>Fix:
Uh, run perl 4.0 which does not have the problem?
>Release-Note:
>Audit-Trail:

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;
 
State-Changed-From-To: open->closed 
State-Changed-By: cjc 
State-Changed-When: Sat Mar 16 11:45:30 PST 2002 
State-Changed-Why:  
Not a bug. That's how precedence of Perl operators is documented to 
work. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=35952 
>Unformatted:
