--perl version 和已安装模块
我要如何移除已经安装了的模块?
使用ExtUtils::Installed和ExtUtils::Packlist这两个模块来实现。下面是一个例子,在ExtUtils::Packlist中有更详细的例子,可以参考一下。
#!/usr/local/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;
================================
perl version
使用ExtUtils::Installed和ExtUtils::Packlist这两个模块来实现。下面是一个例子,在ExtUtils::Packlist中有更详细的例子,可以参考一下。
#!/usr/local/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;
================================
perl version