All the Perl that's Practical to Extract and Report

Navigation

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Without JavaScript enabled, you might want to
use the classic discussion system instead. If you login, you can remember this preference.

At the end of every test, report %INC and at the end of the test run, report every module in %INC, which version is was released with and if it's not core, check if it's listed as a dependency.

Woah there! I agree this would be a nice author test, but it's is much harder than just using %INC.

1) Testing for core status--> For what version of perl? Needs to know what's the minimum version of perl this module runs on. I think since there is no META.yml attribute which is reliable and agreed upon, this needs PPI.

2) %INC has all loaded modules, not just distributions. So you need to check only modules loaded by the modules in the distribution-to-be-tested directly.--> This requires that you determine all modules in the current distribution. Should be reasonably simple in most cases. (glob lib or blib/* or much better: use META's "provides")--> This requires either overloading CORE::require or @INC hackery or both. Or something like Module::ScanDeps (fragile) or a much better implementation using PPI.

3) If our module loads 'Foo::Bar' and there is a declared dependency on 'Foo', one needs to figure out whether 'Foo::Bar' is part of the 'Foo' distribution. I can't think of a way to test this without involving a CPAN client. Also, one level down, if the Foo-distro depends on a distro which includes Foo::Bar, should our module depend on that directly or is the dependency on 'Foo' enough?

I think this sort of module would only do good if it had a robust implementation and that is probably very hard.

That's because you misunderstood me. Given a distribution to be tested, you need to know the minimum perl version it's compatible with to be able to USE Module::CoreList at all. To get a list of core modules, you need a perl version, remember? I mention PPI because it's used to implement Perl::MinimumVersion.

You think a simple implementation that gets us ¾ of the value of a completely airtight implementation is worthless? Why?

I thought it was a given that checking the dependency list is done before you upload to PAUSE. This sort of test would be useless if it ran after your distro ship had sailed.

How touchingly naive:-) It's amazing how many people don't bother checking. Aside from plain and simple coding errors, undeclared dependencies are one of the most common problems with modules. It's hard to blame the authors though. If you use LWP::UserAgent every day it's hard to remember that it's not core. Even harder to remem