Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: LWP vs ExtUtils::Installed vs libwww::perl vs Module::Metadata

by haukex (Archbishop)
on Sep 23, 2018 at 07:52 UTC ( [id://1222879]=note: print w/replies, xml ) Need Help??


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

Note that libwww::perl is not the name of a module, there is no libwww/perl.pm - the distribution is libwww-perl. So I'm not surprised that Module::Metadata is saying that there is no module libwww::perl. It is strange, however, that ExtUtils::Installed is reporting libwww::perl but not finding LWP.pm. Its documentation says "It uses the information stored in .packlist files created during installation to provide this information", and there is a file auto/libwww/perl/.packlist - I'm not sure why it isn't looking at the contents of that file like its documentation describes, which does list LWP.pm (and I don't have too much time right now to dig into the source to see if it's some kind of bug*).

Personally, if I need a core module to check if some module is installed, I like to use check_install from Module::Load::Conditional, although that doesn't handle distribution names like libwww-perl either. You haven't said if/why you need this?

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

Replies are listed 'Best First'.
Re^2: LWP vs ExtUtils::Installed vs libwww::perl vs Module::Metadata
by Anonymous Monk on Sep 23, 2018 at 10:12 UTC
    > 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;
    
    
      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.

Re^2: LWP vs ExtUtils::Installed vs libwww::perl vs Module::Metadata
by Anonymous Monk on Sep 23, 2018 at 09:21 UTC
    Some ?most distros for decade+ remove packlist files so instmodsh can't do its job.. A humble tool it was long ago

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1222879]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2024-04-23 16:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found