Subject: | Having "if" in prerequisite leads to "Prerequisite version too low" error |
Hi David,
When trying to build Wx, which has "if" as prerequisite, I've encountered a problem that CPAN::Reporter discards reports because of "Prerequisite version too low". It happens because CPAN::Reporter::PrereqCheck evaluates "require if;" which produces syntax error.
I downloaded 1.1709 version from GitHub and found that now there's %substitution that can be used to handle "if", but it may require listing other modules too (though I didn't find any on CPAN).
I'm attaching a patch for 1.1709, it replaces 'require Bareword::Module' with 'require "Bareword/Module.pm"', that can handle "if" and other keywords. It may be more reliable if some "not.pm" would appear on CPAN.
--
Serguei Trouchelle
When trying to build Wx, which has "if" as prerequisite, I've encountered a problem that CPAN::Reporter discards reports because of "Prerequisite version too low". It happens because CPAN::Reporter::PrereqCheck evaluates "require if;" which produces syntax error.
I downloaded 1.1709 version from GitHub and found that now there's %substitution that can be used to handle "if", but it may require listing other modules too (though I didn't find any on CPAN).
I'm attaching a patch for 1.1709, it replaces 'require Bareword::Module' with 'require "Bareword/Module.pm"', that can handle "if" and other keywords. It may be more reliable if some "not.pm" would appear on CPAN.
--
Serguei Trouchelle
Subject: | PrereqCheck.pm.diff |
61c61,63
< if ( ! eval "require $testmod; 1" ) {
---
> my $testmodpath = $testmod . '.pm';
> $testmodpath =~ s!::!/!gx;
> if ( ! eval 'require "' . $testmodpath . '"; 1' ) {