Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jan 2005 23:51:36 -0500
From:      Chuck Swiger <cswiger@mac.com>
To:        Andrew McNaughton <andrew@scoop.co.nz>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: [HEADS UP] perl symlinks in /usr/bin will be gone
Message-ID:  <41FC67D8.2020609@mac.com>
In-Reply-To: <20050130162753.D9021@a2.scoop.co.nz>
References:  <20050129202425.GA56998@heechee.tobez.org> <20050129220905.46ab86ae.lehmann@ans-netz.de> <41FBFDD9.7070605@mac.com> <20050130162753.D9021@a2.scoop.co.nz>

next in thread | previous in thread | raw e-mail | index | archive | help
Andrew McNaughton wrote:
> On Sat, 29 Jan 2005, Chuck Swiger wrote:
[ ... ]
>> Well-behaved 3rd party scripts ought to start Perl via:
>>
>> #! /usr/bin/env perl
>>
>> ...so long as /usr/local/bin is in the $PATH, they should still work 
>> fine.
> 
> I commonly use this approach, but I run into some problems with flags.
> Probably a simple gotcha someone can help with.
> 
> Eg the following useful constructs don't work:
> 
> #!/usr/bin/env perl -p
> #!/usr/bin/env perl -T
> #!/usr/bin/env perl -w

See "man perlrun" for some additional suggestions (and caveats), as it gives 
examples for passing -p to perl when invoked via /usr/bin/env or /bin/sh.  You 
might also try putting a "--" between the 'env' and the 'perl' to indicate the 
end of command-line option processing to env.

It's possible that taint mode cannot be invoked this way (as that needs to be 
set very early on), though.  There also seems to exist a PERL5OPT variable 
which could be set like so:

#!/usr/bin/env PERL5OPT='-w' perl

This should support -T, too, only it will zap any additional args specified 
afterwards (or so the docs say)...

-- 
-Chuck



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41FC67D8.2020609>