[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Execing perl?

From: Paul D. Smith
Subject: Re: Execing perl?
Date: Wed, 11 Jul 2001 15:17:37 -0400

%% address@hidden (Paul Jarc) writes:

  pj> This will break *any* interpreter, as long as it's on Linux.  Linux
  pj> passes everything after the first space as a single argument to the
  pj> interpreter.


  pj> The eval stuff isn't what you want anyway, and I don't
  pj> think it ought to be used that way in the perlrun man page.  It's
  pj> meant to be used like this:
  pj>   #!/path/to/perl
  pj>   eval 'exec perl -wS $0 ${1+"$@"}'
  pj>     if $running_under_some_shell;

This can't work for me.

My entire goal is to invoke Perl when I don't know the path.  I have
lots of different systems, with different OS's on them, and Perl is
installed on different places on each of them.  I want to run the same
script on all of them.

If you use an invalid path in the #! commandline, then it just fails.

  pj> The next example in the perlrun man page is what you want:
  pj> #!/usr/bin/env perl
  pj> This assumes a location for env, but searches for perl in $PATH.

I saw that; I don't want to assume a location for env, either.

How frustrating!  Other interpreters all have straightforward ways of
doing this.

Perl is getting too fancy for its own britches, with this special
attempt to emulate sh-bang processing if the word "perl" doesn't appear
on the first line :-/.  At the least there should be a way to disable

 Paul D. Smith <address@hidden>    HASMAT--HA Software Methods & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
   These are my opinions---Nortel Networks takes no responsibility for them.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]