From xemacs-m  Tue Apr  1 08:43:41 1997
Received: from newman (root@newman.aventail.com [199.238.236.1])
	by xemacs.org (8.8.5/8.8.5) with SMTP id IAA15938
	for <xemacs-beta@xemacs.org>; Tue, 1 Apr 1997 08:43:40 -0600 (CST)
Received: from kramer.in.aventail.com.aventail.com (wmperry@kramer [192.168.1.12]) by newman (8.6.12/8.6.9) with SMTP id GAA02036; Tue, 1 Apr 1997 06:10:50 -0800
Date: Tue, 1 Apr 1997 06:10:50 -0800
Message-Id: <199704011410.GAA02036@newman>
From: "William M. Perry" <wmperry@aventail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: sperber@informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor])
Cc: xemacs-beta@xemacs.org
Subject: Re: pstogif
In-Reply-To: <y9l3etbszau.fsf@modas.informatik.uni-tuebingen.de>
References: <y9lbu84yu26.fsf@modas.informatik.uni-tuebingen.de>
	<199703282129.NAA23960@xemacs.eng.sun.com>
	<y9l3etbszau.fsf@modas.informatik.uni-tuebingen.de>
X-Mailer: VM 6.22 under Emacs 19.34.1
Errors-to: wmperry@aventail.com
Reply-to: wmperry@aventail.com
X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7</SYF`{vYQ(&RI1&EiH[FvT;J}@f!4kfz
 x_!Y#=y{Uuj9GvUi=cPuajQ(Z42R[wE@{G,sn$qGr5g/wnb*"*ktI+,CD}1Z'wxrM2ag-r0p5I6\nA
 [WJopW_J.WY;

Michael Sperber [Mr. Preprocessor] writes:
>>>>>> "Martin" == Martin Buchholz <mrb@Eng.Sun.COM> writes:
>
>Martin> Here's the magic I use in all my perl scripts:
>
>Martin> : # -*-Perl-*-
>Martin> eval 'exec perl -w -S $0 ${1+"$@"}' # Portability kludge
>Martin>     if 0;
>
>I'm not sure I made myself clear: How does Perl get executed when you
>start the script?  What I was thinking of was (I think) something that
>started like
>
>#!/bin/sh
><magic incantation that would cause sh to start Perl and
> that Perl ignores>

  That was the magic incantation.  You cannot use #!/bin/sh at the top of
the script, or perl will try to be helpful when you end up invoking 'perl
-w -S foo', and invoke /bin/sh on it for you.  Bleah.

  Martin's little magic will use your default shell as the interpreter, at
least on any sane unix box.

-Bill P.

