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

I have a script that builds a perl and then uses CPANPLUS to install 200-odd CPAN tarballs. Previously I had all that install into a directory under /opt/perl which is where it would finally be installed.

I decided to change and do the installation somewhere else, but soon found @INC wasn't what I needed after moving under /opt/perl. I tried

-Duserelocatableinc

which is supposed incomptible with useshrplib (no longer needed with Darwin for acceptable performance).

@INC then changes as the path to perl does.

However one module, PDF-Report-1.33.tar.gz, now failed "make test" and therefore wasn't installed.

# Failed test 'use PDF::Report;' # at t/00-load.t line 6. # Tried to use 'PDF::Report'. # Error: Insecure dependency in eval while running with -T switch at .../lib/5.10.1/Math/Complex.pm line 36.

as that test runs under -T from Math::Complex

my $nvsize = $Config{nvsize} || ($Config{uselongdouble} && $Config{longdblsize}) || $Config{doublesize}; die "Math::Complex: Could not figure out nvsize\n" unless defined $nvsize; die "Math::Complex: Cannot not figure out max nv (nvsize = $nvsize +)\n" unless defined $DBL_MAX{$nvsize}; my $DBL_MAX = eval $DBL_MAX{$nvsize};

The final part of my perl build script checks modules by trying a one line script "use $mname" for each module listed in 02packages.details.txt against each tarball installed. Changing that to run under '-T' didn't result in any other module having a problem. That's slightly different than building and testing all modules under '-T'.

There's still a reasonable chance I'm doing something wrong, but is this sort of problem expected from 'relocatableinc' ?

Fortunately (?) very little of our code uses taint-mode so I could just remove the '-T' in that test or do the installation manually, or maybe create a symlink under /opt/perl.

I'm really some wisdom on the best approach I should use rather than just whether @INC is tainted.

Danny Thomas

This 5.10.1 was under RHEL5, but don't expect different results under FreeBSD and Darwin.

Replies are listed 'Best First'.
Re: @INC tainted by -Duserelocatableinc ?
by Anonymous Monk on Sep 21, 2010 at 01:31 UTC
    There's still a reasonable chance I'm doing something wrong, but is this sort of problem expected from 'relocatableinc' ?

    Yes, its a feature

    http://perl5.git.perl.org/perl.git/blob?f=Configure

    case "$userelocatableinc" in $define|true|[yY]*) dflt='y' ;; *) dflt='n' ;; esac cat <<EOM Would you like to build Perl so that the installation is relocatable, +so that library paths in @INC are determined relative to the path of the perl +binary? This is not advised for system Perl installs, or if you need to run se +tid scripts or scripts under taint mode.