Path: utzoo!mnetor!uunet!husc6!uwvax!oddjob!ncar!ames!elroy!devvax!lwall
From: lwall@devvax.JPL.NASA.GOV (Larry Wall)
Newsgroups: comp.sources.d
Subject: Re: Perl: Hacking The !# Simulation
Message-ID: <1993@devvax.JPL.NASA.GOV>
Date: 9 May 88 17:31:57 GMT
References: <67@uvaarpa.virginia.edu> <6800012@cpe>
Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall)
Organization: Jet Propulsion Laboratory, Pasadena, CA.
Lines: 23

In article <6800012@cpe> tif@cpe.UUCP writes:
: 
: Written 10:01 am  May  2, 1988 by uvaarpa.UUCP!mer6g in cpe:comp.sources.d
: >What if we could do something like this:
: >
: >eval "exec /bin/perl -S $0 $*"
: >	if $running_via_sh;
: >
: >The -S switch would cause the script file to be searched for either using an
: >algorithm implemented within perl (best case) or else by running a program
: >(ksh, csh, sh) the path to which is configurable and compiled in (acceptable
: >case).
: 
: Along this line, it sounds like perl should have a special variable
: that is like $0 only contains a full path.  I guess that still leaves
: the implementation technique in question.

The current implementation of -S leaves the fully qualified name in $0.
In other words, if you use -S, $0 is guaranteed to point to a real filename
(though it may be relative to the current directory).

Larry Wall
lwall@jpl-devvax.jpl.nasa.gov