From fenner@parc.xerox.com  Fri May 26 16:15:06 1995
Received: from alpha.xerox.com (alpha.Xerox.COM [13.1.64.93])
          by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id QAA04969
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 26 May 1995 16:15:03 -0700
Received: from fenestro.parc.xerox.com ([13.0.208.199]) by alpha.xerox.com with SMTP id <14560(4)>; Fri, 26 May 1995 16:14:09 PDT
Received: (from fenner@localhost) by fenestro.parc.xerox.com (8.6.11/8.6.9) id QAA04792; Fri, 26 May 1995 16:12:10 -0700
Message-Id: <199505262312.QAA04792@fenestro.parc.xerox.com>
Date: Fri, 26 May 1995 16:12:10 PDT
From: Bill Fenner <fenner@parc.xerox.com>
Reply-To: fenner@parc.xerox.com
To: FreeBSD-gnats-submit%freebsd.org@alpha.xerox.com
Subject: perl's $] variable is broken
X-Send-Pr-Version: 3.2

>Number:         449
>Category:       gnu
>Synopsis:       perl's $] variable is broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 26 16:20:02 1995
>Closed-Date:    Sun May 28 12:22:07 PDT 1995
>Last-Modified:
>Originator:     Bill Fenner
>Release:        FreeBSD 2.1.0-Development i386
>Organization:
Xerox PARC
>Environment:

	
	FreeBSD-2.0 SNAP-950412

>Description:

	
	Perl's $] variable returns "4", not "4.036":

	% perl
	print $] + 0;
	4% 

	On a Sun:

	crevenia% perl
	print $] + 0;
	4.0359999999999995879crevenia% 

	This also appears to (from reading the code) break the auto
	running of taintperl and suidperl.


>How-To-Repeat:

	
	print the perl $] value in a numerical context.

>Fix:
	
	
	Believe it or not, the fix is to put the rcsid back.  Given the
	existing rcsid of

	$RCSfile: perl.c,v $$Revision: 1.2 $$Date: 1994/10/27 23:16:54 $

	the "patchlevel" variable gets set to "4/136", which atof() returns
	4.0 for.  The Revision needs to be 4.0 to get the proper behavior.

	(see usr/src/gnu/usr.sbin/perl/perl/perl.c, line 128:

        sprintf(patchlevel,"%3.3s%2.2d", index(rcsid,'4'), PATCHLEVEL);

	Of course, another fix would simply be to change this to

	sprintf(patchlevel,"%3.3s%2.2d", "4.0", PATCHLEVEL);

	since it's pretty ill to use the rcsid in this manner...
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ache 
State-Changed-When: Sun May 28 12:22:07 PDT 1995 
State-Changed-Why:  
Applied in perl.c v1.3 
>Unformatted:



