http://qs321.pair.com?node_id=1222887


in reply to Re: LWP vs ExtUtils::Installed vs libwww::perl vs Module::Metadata
in thread LWP vs ExtUtils::Installed vs libwww::perl vs Module::Metadata

> You haven't said if/why you need this?

I'm analyzing Perl and have discovered 4 distributions out of about 1000 CPAN installations where ExtUtils::Installed and Module::Metadata don't agree:

1. LWP (or libwww::perl) 1222878
2. MIDI (or MIDI-Perl) 1222886
3. Astro (Namespace appears as a module to ExtUtils::Installed->modules())
4. Role::Identifiable (doesn't really exist)


perl -MExtUtils::Installed -le 'print join "\n", grep /astro/i, ExtUtils::Installed->modules()'

Astro
Astro::Constants
Astro::Coord::ECI
Astro::Coords
Astro::FITS::Header
Astro::MapProjection
Astro::MoonPhase
Astro::PAL
Astro::Sunrise
Astro::Telescope
Astro::Time::HJD
Astro::Units
Astro::WaveBand
DateTime::Astro

perl -MExtUtils::Installed -le 'print join "\n", ExtUtils::Installed->files("Astro")'

/perl-5.26.2/lib/site_perl/5.26.2/Astro/Coord.pm
/perl-5.26.2/lib/site_perl/5.26.2/Astro/Misc.pm
/perl-5.26.2/man/man3/Astro::Time.3
/perl-5.26.2/lib/site_perl/5.26.2/Astro/Time.pm
/perl-5.26.2/man/man3/Astro::Coord.3
/perl-5.26.2/man/man3/Astro::Misc.3

perl -MModule::Metadata -MData::Dumper -le 'print(Dumper(Module::Metadata->new_from_module("Astro")))'

$VAR1 = undef;

Finally:

perl -MExtUtils::Installed -le 'print join "\n", grep /identifiable/i, ExtUtils::Installed->modules()'

Role::Identifiable

perl -MExtUtils::Installed -le 'print join "\n", ExtUtils::Installed->files("Role::Identifiable")'

/perl-5.26.2/man/man3/Role::Identifiable::HasIdent.3
/perl-5.26.2/lib/site_perl/5.26.2/Role/Identifiable/HasTags.pm
/perl-5.26.2/lib/site_perl/5.26.2/Role/Identifiable/HasIdent.pm
/perl-5.26.2/man/man3/Role::Identifiable::HasTags.3

perl -MModule::Metadata -MData::Dumper -le 'print(Dumper(Module::Metadata->new_from_module("Role::Identifiable")))'

$VAR1 = undef;

  • Comment on Re^2: LWP vs ExtUtils::Installed vs libwww::perl vs Module::Metadata

Replies are listed 'Best First'.
Re^3: LWP vs ExtUtils::Installed vs libwww::perl vs Module::Metadata
by haukex (Archbishop) on Sep 24, 2018 at 07:55 UTC
    I'm analyzing Perl

    Could you be more specific? Are you hunting bugs in ExtUtils::Installed? Because that's what this issue feels like to me at the moment, although I still don't have enough time to investigate in detail.*

    If you're not hunting bugs, perhaps you could explain what exactly you've analyzing and why, then we could probably suggest more fitting tools. If I guess you might be trying to figure out which modules are installed and which files belong to which distributions, then why not just use one reliable tool (maybe that's Module::Metadata?) instead of trying two?

    You also haven't said if you need to figure out distribution names as well; in this node there appears to still be a mixup of distribution names (MIDI-Perl) with actual modules (MIDI/MIDI.pm).

    * Update: See my post here, looks like a bug to me.