Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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!

Replies are listed 'Best First'.
Re: ExtUtils::Installed .... has it changed?
by syphilis (Chancellor) 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?
[Corion]: marto: Aah ;) Yeah - I guess I'll make the first changes to the old module, by extending its test suite to be more lenient, and then the switch to the new results should still pass the test suite :-D
[Corion]: Maybe that's more "boiling a frog", but my toolkit of Machiavellian practices is fairly small

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2018-07-16 09:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (333 votes). Check out past polls.

    Notices?