Skip Menu |

This queue is for tickets about the Module-CPANTS-Analyse CPAN distribution.

Report information
The Basics
Id: 35614
Status: resolved
Priority: 0/
Queue: Module-CPANTS-Analyse

People
Owner: Nobody in particular
Requestors: cjm [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.81
Fixed in: (no value)



Subject: prereq_matches_use complains about fallback module
Unfortunately, even after #35092 was resolved, http://cpants.perl.org/dist/kwalitee/WebService-NFSN still shows it failing prereq_matches_use. Now, the problem is this bit of code: BEGIN { ## no critic ProhibitStringyEval eval "use JSON::XS ();"; if ($@) { # Can't find JSON::XS, try JSON (2.0 or later): eval "use JSON qw(decode_json); 1" or die $@; } else { if ($JSON::XS::VERSION >= 2) { *decode_json = \&JSON::XS::decode_json; } else { *decode_json = \&JSON::XS::from_json; # old name for decode_json } # end else found JSON::XS prior to version 2.0 } # end else we were able to load JSON::XS } # end BEGIN Here, I'm trying to use JSON::XS (which is listed in "requires"), and falling back to JSON if necessary. But prereq_matches_use thinks both JSON::XS and JSON are required. I'm not sure how this can be resolved, short of adding a "fallbacks" section to META.yml. JSON doesn't belong in "requires" or "recommends".
On Sun May 04 07:33:41 2008, CJM wrote: Show quoted text
> Unfortunately, even after #35092 was resolved, > http://cpants.perl.org/dist/kwalitee/WebService-NFSN still shows it > failing prereq_matches_use. Now, the problem is this bit of code: > > BEGIN > { > ## no critic ProhibitStringyEval > eval "use JSON::XS ();"; > if ($@) { > # Can't find JSON::XS, try JSON (2.0 or later): > eval "use JSON qw(decode_json); 1" or die $@; > } else { > if ($JSON::XS::VERSION >= 2) { > *decode_json = \&JSON::XS::decode_json; > } else { > *decode_json = \&JSON::XS::from_json; # old name for decode_json > } # end else found JSON::XS prior to version 2.0 > } # end else we were able to load JSON::XS > } # end BEGIN > > Here, I'm trying to use JSON::XS (which is listed in "requires"), and > falling back to JSON if necessary. But prereq_matches_use thinks both > JSON::XS and JSON are required. > > I'm not sure how this can be resolved, short of adding a "fallbacks" > section to META.yml. JSON doesn't belong in "requires" or "recommends".
This should have been fixed since 0.88 (modules only used in eval blocks are ignored now). If you still suffer from the same issue, please reopen this. Thanks.