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

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

does your cpan client disable sitecustomize.pl ? PERL5OPT?

I thought I'd fun up an install I have with sitecustomize.pl with

use Data::Dump qw/ dd pp /; use Time::HiRes qw/ time sleep /; use Benchmark qw/ cmpthese /;

After about a year I noticed some tests failing because of time ( 1376987115 != 1376987115.29688 )

Even if I used  $ENV{PERL5OPT}=q{ -MData::Dump=dd,pp -MTime::HiRes=time,sleep -MBenchmark=cmpthese }; the same tests would fail

I think pretty much all cpan clients let these options though, so now I switched to

my $cpanclients = grep { exists $ENV{$_} } qw{ AUTOMATED_TESTING NONINTERACTIVE_TESTING EXTENDED_TESTING RELEASE_TESTING AUTHOR_TESTING PERL5_CPANPLUS_IS_VERSION PERL5_CPANPLUS_IS_RUNNING PERL5_CPAN_IS_RUNNING CPAN_SHELL_LEVEL };;;;;; use if !$cpanclients qw/ Data::Dump dd pp /; use if !$cpanclients qw/ Time::HiRes time sleep /; use if !$cpanclients qw/ Benchmark cmpthese /;

I can understand inheriting @INC changes, but not all the other stuff

Replies are listed 'Best First'.
Re: does your cpan client disable sitecustomize.pl ? PERL5OPT? be careful
by Corion (Patriarch) on Aug 20, 2013 at 09:02 UTC

    If you override builtins globally, I would expect at least the tests of the test suite failing for modules that don't expect the modified version of the builtin.

    Also, $ENV{PERL5OPT} might be necessary for "your Perl" to run in a meaningful way, so disabling/eliminating PERL5OPT is not a good solution for a CPAN client either.

    I suggest not overriding builtins globally in your perl. Maybe have an alias for the interactive Perl, like myperl, which sets up PERL5OPT and then runs/execs perl.

      Also, $ENV{PERL5OPT} might be necessary for "your Perl" to run in a meaningful way

      Aside from changing @INC what could be necessary? All the other perlrun options could break any/every/test/Makefile.PL

      Maybe have an alias for the interactive Perl

      You must be wearing two thinking caps :)

      Thanks