From andrew@sally.ugh.net.au  Fri Jun 13 03:52:34 1997
Received: from css.tuu.utas.edu.au (root@css.tuu.utas.edu.au [131.217.115.65])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA23741
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 13 Jun 1997 03:52:32 -0700 (PDT)
Received: from sally.ugh.net.au (dialin52.hbt.utas.tassie.net.au [203.57.208.52])
	by css.tuu.utas.edu.au (8.8.5/8.8.5) with ESMTP id UAA03573
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 13 Jun 1997 20:52:41 +1000 (EST)
Received: (from andrew@localhost)
	by sally.ugh.net.au (8.8.5/8.8.5) id BAA00860;
	Tue, 10 Jun 1997 01:21:57 +1000 (EST)
Message-Id: <199706091521.BAA00860@sally.ugh.net.au>
Date: Tue, 10 Jun 1997 01:21:57 +1000 (EST)
From: Andrew <andrew@sally.ugh.net.au>
Reply-To: andrew@ugh.net.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: perl and the $0 variable
X-Send-Pr-Version: 3.2

>Number:         3859
>Category:       bin
>Synopsis:       Setting the $0 variable in perl dosnt do as is expected.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 13 04:00:03 PDT 1997
>Closed-Date:    Mon Mar 29 17:30:26 PST 1999
>Last-Modified:  Mon Mar 29 17:30:51 PST 1999
>Originator:     Andrew
>Release:        FreeBSD 2.2.2-RELEASE i386
>Organization:
UgH!
>Environment:

andrew@sally~/syncpass>perl -v

This is perl, version 4.0

$RCSfile: perl.c,v $$Revision: 1.7 $$Date: 1996/06/30 09:47:56 $
Patch level: 36

Copyright (c) 1989, 1990, 1991, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 4.0 source kit.

>Description:

In perl you are meant to be able to set the "name" of the current running process as seen by ps by setting the $0 variable. Unfortunatley it the name of the process seems to be set to the value of $0 and an awful lot of spaces (they are spaces and not tabs or something - ps > file --FTP--> mac > text editor).

From memory this worked in earlier versions of FreeBSD (and whatever versions of perl they came with) such as 2.1.5. This problem effects perl 5.003 as from the ports collection as well.

>How-To-Repeat:

Run:
	perl -e '$0 = "hmm"; sleep 1000;'

the suspend it and type ps -uww (the ww is so the entire command is printed, not just the first few characters).

>Fix:
	
	

>Release-Note:
>Audit-Trail:

From: Ollivier Robert <roberto@keltia.freenix.fr>
To: andrew@ugh.net.au
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/3859: perl and the $0 variable
Date: Fri, 13 Jun 1997 20:01:29 +0200

 According to Andrew:
 > In perl you are meant to be able to set the "name" of the current running
 > process as seen by ps by setting the $0 variable. Unfortunatley it the
 > name of the process seems to be set to the value of $0 and an awful lot
 > of spaces (they are spaces and not tabs or something - ps > file --FTP-->
 > mac > text editor).
 
 5.004 seems not to be affected by this:
 
 roberto 12919  0.0  1.8   204 1104  p4  S+    7:59PM   0:00.03 hmm (perl)
 
 PS: your lines are way too long...
 -- 
 Ollivier ROBERT -=- FreeBSD: There are no limits -=- roberto@keltia.freenix.fr
 FreeBSD keltia.freenix.fr 3.0-CURRENT #18: Sun Jun  8 15:32:28 CEST 1997
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Mon Mar 29 17:30:26 PST 1999 
State-Changed-Why:  
Asked and answered. 
>Unformatted:
