Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

does your cpan client disable sitecustomize.pl ? PERL5OPT? be careful

by Anonymous Monk
on Aug 20, 2013 at 08:57 UTC ( #1050151=perlquestion: print w/ replies, xml ) Need Help??
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

Comment on does your cpan client disable sitecustomize.pl ? PERL5OPT? be careful
Select or Download Code
Re: does your cpan client disable sitecustomize.pl ? PERL5OPT? be careful
by Corion (Pope) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1050151]
Approved by vsespb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2014-12-26 11:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls