[Israel.pm] Removing PERLLIB additions to @INC

Mikhael Goikhman migo at homemail.com
Wed Jan 14 06:57:51 PST 2004

On 14 Jan 2004 15:55:46 +0200, Yuval Kogman wrote:
> On Wed, Jan 14, 2004 at 11:05:07AM +0200, David Baird wrote:
> > Oh silly me, I found the solution. I carefully read perlrun to
> > understand what I needed. Gabor already suggested it.
> If at some point you need to have a script without tainting perhaps
> something resemblant of
> #!/bin/sh -c 'unset PERL5LIB; unset PERLLIB; /usr/bin/perl $@'
> (untested) may be useful.

This syntax may or may not work depending on /bin/sh. But you don't
really need to depend on a shell or write any wrapper. The standard shell
independent way to change the child process environment on unix is:

  env PERL5LIB= PERLLIB= HOME=/tmp your_perl_script

This is portable. If you want to be less portable, use GNU env extensions
(genv on non GNU systems):

  env -u PERL5LIB -u PERLLIB your_perl_script


perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'

More information about the Perl mailing list