http://www.perlmonks.org?node_id=749754

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am working on getting a local installation of CPAN working, and in most cases following the instructions here have worked perfectly.

However, some module installations have tests with the -T flag. Test::Pod is an example. Even though my local installation paths are set in the $PERL5LIB environment variable, I am getting failures on the tests due to "module not found in @INC" and the displayed @INC does not contain the paths specified in $PERL5LIB. Normal taint behavior (according to perlsec) ignores this env var, but documentation for test_harness says it will load them into @INC for those in my scenario. I also tried adding -I and -Mlib= arguments to the FULLPERL definition in the makepl_arg argument in the ~/.cpan/CPAN/MyConfig.pm to no avail, regardless of the quoting methods I used. Only if I typo the path to not be those in $PERL5LIB will they show up in the @INC error message on the test failure.

How should one work around tests with the taint flag with local installations via CPAN? Modifying the test files themselves to remove the -T argument, or to add in 'use lib ="~/lib/perl5";' seems to be a very inelegant solution.

Example Info

From "perl -V":

%ENV: PERL5LIB="/home/dirvine/lib/perl5:/home/dirvine/lib/site_perl" @INC: /home/dirvine/lib/perl5/aix-thread-multi /home/dirvine/lib/perl5 /home/dirvine/lib/site_perl/5.8.2/aix-thread-multi /home/dirvine/lib/site_perl/5.8.2 /home/dirvine/lib/site_perl /usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2 /usr/opt/perl5/lib/site_perl
From "perl -MCPAN -e shell":

ibm02:/home/dirvine/.cpan/CPAN> perl -MCPAN -e shell cpan shell -- CPAN exploration and modules installation (v1.9304) ReadLine support enabled cpan[1]> test Test::Pod
skip
Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" + "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00-load.t ............ 1/1 # Failed test (t/00-load.t at line 8) # Tried to use 'Test::Pod'. # Error: Can't locate Pod/Simple.pm in @INC (@INC contains: /home +/dirvine/.cpan/build/Test-Pod-1.26-CUlfA6/blib/lib /home/dirvine/.cpa +n/build/Test-Pod-1.26-CUlfA6/blib/arch /usr/opt/perl5/lib/5.8.2/aix-t +hread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8 +.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2 /usr/opt/perl5 +/lib/site_perl) at /home/dirvine/.cpan/build/Test-Pod-1.26-CUlfA6/bli +b/lib/Test/Pod.pm line 67.

Replies are listed 'Best First'.
Re: Local CPAN instalation and test's with taint flags
by cosmicperl (Chaplain) on Mar 11, 2009 at 03:20 UTC
    but documentation for test_harness says it will load them into @INC for those in my scenario
    Have you tried upgrading your version of Test::Harness?

    Lyle
      CPAN says my Test::Harness is up-to date (3.16). Thank you for the suggestion though.
        While I was looking at Data::FormValidator changes file I noticed a change that said one of the tests was fixed for a taint problem with PERL5LIB...

        Not sure if you'll be able to dig about there for a solution...


        Lyle