卸载Perl中的模块

| 暂无评论 | 暂无引用通告

-->
  在你的命令搜索目录中添加一个脚本命名为rmperlmod.pl并赋于可执行权限,将以下内容(cpan的faq中的脚本)添到脚本中: 
#!/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;
  用法如下:
[root@supersun bin]# rmperlmod.pl DBD::mysql
removing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Bundle/DBD/mysql.pm
removing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBD/mysql.pm
removing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBD/mysql/GetInfo.pm
removing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBD/mysql/INSTALL.pod
removing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/mysql/mysql.bs
removing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/mysql/mysql.so
removing /usr/share/man/man3/Bundle::DBD::mysql.3pm
removing /usr/share/man/man3/DBD::mysql.3pm
removing /usr/share/man/man3/DBD::mysql::INSTALL.3pm
removing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/mysql/.packlist
 

暂无引用通告

发送引用通告网址: http://supersun.info/mt/mt-tb.cgi/757
如果您想引用这篇日记到您的Blog,请复制上面的链接,放置到您发表文章时的相应界面中。

发表评论

最新资源

  • IMG_1437.JPG
  • line.png
  • bar.png
  • perl_calander.jpg

关于此日记

此日记由 supersun 发表于 2007年9月20日 15:02

此Blog上的上一篇日记mysql中给用户赋权限

此Blog上的下一篇日记哈特谢普苏特(Hatshepsut)

首页归档页可以看到最新的日记和所有日记。