Subject: | PrereqCheck fails if JSON and JSON::XS are specified together |
To reproduce the problem:
$ PERL=perl
$ (echo JSON; echo JSON::XS) | $PERL `$PERL -S perldoc -l
CPAN::Reporter::PrereqCheck`
JSON 1 2.53
JSON::XS 0 broken
I think the root of the problem is that CPAN::Reporter::PrereqCheck is
doing the require call on a filename, and not on a bareword. This works:
$ $PERL -e 'require JSON; require JSON::XS;'
(no output, no error)
But this fails:
$ $PERL -e 'require
"/home/cpansand/var/ctps/5141RC1/install/perl-5.14.1-RC1/lib/site_perl/5.14.1/JSON.pm";
require
"/home/cpansand/var/ctps/5141RC1/install/perl-5.14.1-RC1/lib/site_perl/5.14.1/i386-freebsd/JSON/XS.pm"'
Modification of a read-only value attempted at
/home/cpansand/var/ctps/5141RC1/install/perl-5.14.1-RC1/lib/site_perl/5.14.1/i386-freebsd/JSON/XS.pm
line 1461.
Compilation failed in require at -e line 1.
(or to reproduce it without hardcoded paths, you can use:
$PERL -le 'require JSON; require JSON::XS; print qq{require
"$INC{"JSON.pm"}"; require "$INC{"JSON/XS.pm"}"}' | $PERL
)
Maybe it would be better if CPAN::Reporter::PrereqCheck sets @INC
instead and uses "require Module" instead of "require $file"?
Regards,
Slaven