From: Graham Knop Date: Wed, 12 Feb 2014 16:07:56 +0000 (-0500) Subject: don't load CPAN.pm to check its version X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fremotes%2Fmirror%2Fcareful-xs;p=p5sagit%2Fstrictures.git don't load CPAN.pm to check its version --- diff --git a/Makefile.PL b/Makefile.PL index 2d665e5..4af82f0 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -43,8 +43,11 @@ my $have_compiler my $support_configure_requires = $ENV{PERL5_CPANM_IS_RUNNING} || !$ENV{PERL5_CPAN_IS_RUNNING} - || ! eval { require CPAN } - || $CPAN::VERSION > 1.94_55; + || do { + my ($cpanpm) = grep { -e } map { "$_/CPAN.pm" } @INC; + my $v = $cpanpm && MM->parse_version($cpanpm); + ($v and $v = eval $v) ? $v > 1.94_55 : 1; + }; WriteMakefile(