Re: Problem with LWP when using : to start scripts

Gisle Aas (gisle@aas.no)
22 Jan 1998 11:02:40 +0100


Nathan Neulinger <nneul@umr.edu> writes:

> On my site, I have several different perl versions installed. I usually 
> like to have the modules fire off the correct perl depending on which one 
> they were built with - i.e. h2xs and such.
> 
> Second, I have perl stored in a directory that has a LONG path. Normally 
> people access perl through a symlink, but when installing, the path has 
> to be specified directly. This doesn't work with #! since it is too long. 
> However, it works just fine with the : eval exec model.
> 
> So, when I build perl, I tell it to exec scripts with the : method.
> 
> With the extra scripts in the perl source, this is handled properly, 
> however with the scripts that LWP installs, this is not handled 
> correctly, and generates a script that looks like:
> 
> -----
> : # use perl -w
> 
> # $Id: lwp-download.PL,v 1.5 1997/12/03 21:21:00 aas Exp $
> 
> =head1 NAME
> -----
> 
> This won't run at all.
> 
> It would be good to add in the eval exec line to handle this case.

We used to have an:

  eval 'exec perl -w -S $0 ${1+"$@"}'
    if 0;

line at the beginning of the scripts.  Then at some Perl version
MakeMaker started adding these lines automatically using MY->fixin().
This made the installed scripts have two exec lines like the one
above.

I think the solution is to fix the MakeMaker fixin() method so that it
also recoginze start lines like yours.

Regards,
Gisle