CPANによってインストールしたPerlモジュールを簡単に削除する方法。
CPAN Faqから消えててWeb Archiveから掘り出した。
また要るかもしれないのでここにメモ。

#!/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;

こいつをremove.plなどとして保存。

$perl ./remove.pl モジュール名

で削除実行。

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

return
odoruinu.net, softwares, drawings & photography by noradaiko.
all copyright(C) 2008 noradaiko.