Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jun 1997 01:21:57 +1000 (EST)
From:      Andrew <andrew@sally.ugh.net.au>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/3859: perl and the $0 variable
Message-ID:  <199706091521.BAA00860@sally.ugh.net.au>
Resent-Message-ID: <199706131100.EAA23975@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 13 04:00:03 PDT 1997
>Last-Modified:
>Originator:     Andrew
>Organization:
UgH!
>Release:        FreeBSD 2.2.2-RELEASE i386
>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:
	
	

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706091521.BAA00860>