[Israel.pm] taint mode and local::lib

Gabor Szabo szabgab at gmail.com
Tue Nov 2 01:09:47 PDT 2010


Using local::lib dictates the use of PERL5LIB which is disabled when
using a script in -T Taint-mode.

Does anyone have a recommendation on how to use the two together?

I added this code to my scripts, but I am not sure if this is the best solution.

BEGIN {
        # sanitize variables to make Taint mode happy
        if ($ENV{PERL5LIB}) {
                my ($path) = $ENV{PERL5LIB} =~ m{   ([\w/:-]+)  }x;
                unshift @INC, split /:/, $path;
        }
}


regards
   Gabor


More information about the Perl mailing list