Xref: utzoo comp.sources.d:4294 alt.sources.d:228 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!uunet!bfmny0!tneff From: tneff@bfmny0.UU.NET (Tom Neff) Newsgroups: comp.sources.d,alt.sources.d Subject: Re: Perl scripts on systems without "#!" Message-ID: <14840@bfmny0.UU.NET> Date: 2 Nov 89 20:17:59 GMT References: <1125@kl-cs.UUCP> <2473@convex.UUCP> <14810@bfmny0.UU.NET> <13411@orstcs.CS.ORST.EDU> <255072E0.20005@ateng.com> Reply-To: tneff@bfmny0.UU.NET (Tom Neff) Followup-To: comp.sources.d Lines: 26 Summary: Expires: Sender: Followup-To: In article <255072E0.20005@ateng.com> chip@ateng.com (Chip Salzenberg) writes: >Therefore, all Perl scripts on my system begin with these two lines: > > eval 'exec /bin/perl -S $0 ${1+"$@"}' > if $running_under_some_shell; > >I have yet to extend this method in a way that works for the C shell. If I >could do so, then starting the script with "#!" would work on Xenix. Does >anyone out there have an idea? According to my notes, CSH looks for a colon ':' as the first token in a script and passes it on to /bin/sh if the colon is seen. So perhaps : eval 'exec /bin/perl -S $0 ${1+"$@"}' if $running_under_some_shell; would do the trick. But the problem here is that PERL hates the colon! So you could set up a script like this for script execution, but not feed it to perl unmodified. Perl being still under modification, perhaps it could be fixed to accept this. Or is there a clever perl-ism that would let us put the colon there. -- I'm a Leo. Leos don't believe * * * Tom Neff in this astrology stuff. * * * tneff@bfmny0.UU.NET