Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

ExtUtils::Installed .... has it changed?

by mwhiting (Beadle)
on Jul 05, 2013 at 15:37 UTC ( #1042737=perlquestion: print w/ replies, xml ) Need Help??
mwhiting has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks. I have a little snippet of code I used to use to check to see if CGI::Session is installed on a server:
use ExtUtils::Installed; my $installed = ExtUtils::Installed->new(); print "and ..."; if (grep(/CGI::Session/,$installed->modules() )) { print "found it."; } else { print "didn't find it."; } exit;
This check doesn't seem to work anymore ... I have CGI:Session installed and it works fine, but this routine doesn't show it. I have a similar one to show all installed modules:
print "<p>Finding all installed modules...<br>\n"; my $installed2 = ExtUtils::Installed->new(); foreach my $module ($installed2->modules) { my $version = $installed2->version($module) || "<no version info>"; print("Found module $module Version $version<br>\n"); }
and it only shows the perl core:
Finding all installed modules... Found module Perl Version 5.10.0 Script finished.

I would actually prefer an all-perl solution that doesn't use grep so it is more OS-independent .... but why doesn't this show me any installed module names? (or ... hmmm, is Session part of the core now?)

Thanks!

Comment on ExtUtils::Installed .... has it changed?
Select or Download Code
Re: ExtUtils::Installed .... has it changed?
by syphilis (Canon) on Jul 06, 2013 at 00:02 UTC
    ExtUtils::Installed determines what modules have been installed by examining the '.packlist' files created during module installation. If you install CGI::Session via a method that doesn't create a .packlist file, then CGI::Session won't be found by ExtUtils::Installed.

    Do you have a .packlist file for CGI::Session ?
    On my windows box the relevant .packlist would be found in perl/site/lib/auto/CGI/Session, though it wouldn't hurt to check that Session.pm is not listed in the .packlist one directory back (which would be perl/site/lib/auto/CGI/.packlist on this Windows box).

    If CGI/Session.pm *is* being specified in a .packlist, then we need to work out why your script fails to list it - otherwise you have the answer as to why it's not being listed.

    Cheers,
    Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1042737]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-08-20 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (121 votes), past polls