in reply to Checking to see if a particular Module is installed
use ExtUtils::Installed;
my ($inst) = ExtUtils::Installed->new();
my (@modules) = $inst->modules();
my (@missing) = $inst->validate("DBI");
my $all_files = $inst->files("DBI");
my $files_below_usr_local = $inst->files("DBI", "all", "/usr/local");
my $all_dirs = $inst->directories("DBI");
my $dirs_below_usr_local = $inst->directory_tree("DBI", "prog");
my $packlist = $inst->packlist("DBI");
- above info retrieved from www.perl.com
---------------------------------------------------
from shell : perl -MFoo -we 1
where Foo is module name, to find out if Foo is installed
-got from a chat session / which turned into a post
Update: punkkid is right, but he forgot ';'
This'll work just as well:
if(eval("require CGI;"))
{ print "CGI is here";}
______________________________________________
|_____¸.·ooO--(> cRaZy is co01. <)--Ooo·.¸_____|
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
|
|---|