This first script will list the perl modules you have installed and the version number.


#!/usr/bin/perl
#
use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
foreach my $module ($instmod->modules()) {
my $version = $instmod->version($module) || "???";
print "$module -- $version\n";
}

This 2nd will uninstall a perl module by passing it the module name.
i.e.

./filename.pl Mail::Bulkmail


#!/usr/bin/perl -w
use ExtUtils::Packlist;
use ExtUtils::Installed;
#
$ARGV[0] or die "Usage: $0 Module::Name\n";
#
my $mod = $ARGV[0];
#
my $inst = ExtUtils::Installed->new();
#
foreach my $item (sort($inst->files($mod))) {
print "removing $item\n";
unlink $item;
}
#
my $packfile = $inst->packlist($mod)->packlist_file();
print "removing $packfile\n";
unlink $packfile;

Categories: LAMP

Jonathan Adjei

Jon's expertise in web development is legendary and he oversees all technical aspects of our projects from development to hosting (all through the command line!) Jon is excited by the latest techniques and keeps the company on track by finding ways to adopt new practices into our workflow.