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:
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: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;
and it only shows the perl core: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"); }
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 (Archbishop) on Jul 06, 2013 at 00:02 UTC |
Back to
Seekers of Perl Wisdom