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
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
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
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' ?
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
>
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
--- "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
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
: 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
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 ;-)
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
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
12 matches
Mail list logo