Subject: Re: [PATCH] Try 2: Allow PERL_PATH="/usr/bin/env perl"

From: Bryan Larsen <[email-masked]>
Date: Thu, 03 May 2007 19:35:51 -0400

Junio C Hamano wrote:
> Bryan Larsen <[email-masked]> writes:
> 
>> The perl scripts start with "#!/usr/bin/perl".  There is a mechanism
>> PERL_PATH in the Makefile to change this, but it currently doesn't work
>> with PERL_PATH="/usr/bin/env perl".
> 
> I do not get this whole business.  Why would you even want to
> support that to begin with?
> 
> The purpose of PERL_PATH is for you to tell git the path you
> have your Perl at.  It is not about supplying a small shell
> script that lets "env" to figure it out.
> 

Maybe PERL_PATH should be renamed PERL_SHEBANG or something.  Because if 
you pass in something that doesn't work on a shebang line (longer than 
32 characters, say), it just won't work.

I was under the impression that "#!/usr/bin/env perl" was the "right" 
way to invoke perl.  But I'm not doing this because I want to do the 
"right" thing.  I'm doing this because it makes this scenario work:

$ sudo port install git-core
installing openssl...
installing openssh...
installing curl...
installing expat...

$ ...
$ git-send-email ...
$ ...

$ sudo port install git-svn
installing apr...
installing subversion...
installing perl...
installing p5-svn-simple...

git-core works fine with stock perl, and we don't want to install extra 
megabytes of unneeded stuff if it really isn't needed.

Certainly there are other ways of making this work.  But they're all 
uglier than doing the "right" thing of "/usr/bin/env perl".

cheers,
Bryan

P.S.
On Linux, "#!/usr/bin/env perl -w" doesn't work.  On OS X it works fine.