Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Timothy Kimball
Stephen Neu wrote: : ... Otherwise, you have code that needs to : find Perl so it can run the code that needs to find Perl so it can run the : code that needs to find Perl so it can... etc. Or you can run "perl" on a fixer script and have it edit the script for you. That's what my solution doe

Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Steve Neu
Perhaps people understand this already, but I wanted to state it, because I haven't heard it specifically said. (Redundancy is good in a learning environment) The point is that, if you do not know where Perl is located, you likely cannot run the script without finding Perl. For this reas

Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Peter Cornelius whispered: | The camel book suggests the following: | | #!/bin/sh -- | eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' | if 0; | | Is this the best alternative and are there situations in which it might not | work? The camel suggests this for

RE: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Peter Cornelius
The camel book suggests the following: #!/bin/sh -- eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; Is this the best alternative and are there situations in which it might not work? I haven't tried to script it but what about 'which perl' ?

RE: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Scott Thompson
Original Message- > From: Paul [mailto:[EMAIL PROTECTED]] > Subject: Re: Is there an alternative to #!/usr/bin/perl > > > > > #!/bin/sh -- > > eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' > > if 0; > > But that's not to find perl -- that in fact assumes it's /usr/bin/perl. > > Geez, this one's tricky >

Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Timothy Kimball
Neville hobson wrote: : I'm writing perl scripts that will be distributed to locations where I : cannot gaurantee the location of perl. Is there a clean alternative to the : shebang with the specific perl path? Maybe using an environment variable to : locate perl? OK, here's one solution, extrac

Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Paul
--- "Hobson, Neville" <[EMAIL PROTECTED]> wrote: > I'm writing perl scripts that will be distributed to locations where > I cannot gaurantee the location of perl. Is there a clean alternative > to the shebang with the specific perl path? Maybe using an environment > variable to locate perl? > The

Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Adam Turoff
On Thu, May 24, 2001 at 11:38:32AM +0100, Hobson, Neville wrote: > I'm writing perl scripts that will be distributed to locations where I > cannot gaurantee the location of perl. Is there a clean alternative to the > shebang with the specific perl path? Maybe using an environment variable to > loc

Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Timothy Kimball
: I'm writing perl scripts that will be distributed to locations where I : cannot gaurantee the location of perl. Is there a clean alternative to the : shebang with the specific perl path? Maybe using an environment variable to : locate perl? This may be a heavier solution than you were looking

Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Nigel G Romeril
I think that you will have to program the humans, eg send a Readme out with the scripts and let them do a little editing to get the script to run. If you do not know where Perl is or it is not on the path then you cannot run it so you cannot do any searching. We could call it Hobson's choice ;-)

Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Jos I Boumans
well, it would probably involve some parsing not sure how you want to solve that, but try running this on your box: for (keys %ENV) { print "$_ has value $ENV{$_}\n" } # this will print out all ENV key/values for you $ENV{PATH} has the following contents on my machine: C:\winnt\system32;C:\winnt

Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Hobson, Neville
I'm writing perl scripts that will be distributed to locations where I cannot gaurantee the location of perl. Is there a clean alternative to the shebang with the specific perl path? Maybe using an environment variable to locate perl? The camel book suggests the following: #!/bin/sh -- eval 'exec