怎么卸载perl模块
答案:1 悬赏:50 手机版
解决时间 2021-04-23 11:34
- 提问者网友:太高姿态
- 2021-04-22 15:07
怎么卸载perl模块
最佳答案
- 五星知识达人网友:往事埋风中
- 2021-04-22 16:32
到 perl 的安装目录下, 找 /lib , 里面每一个 .pm 的档就是一个 perl 自带的模块
到 perl 的安装目录下, 找 /site/lib , 里面每一个 .pm 的档就是一个你自己安装下去的模块
没有一个预设的方式去移除模块, 但你可以写下面这个程序, 然後存起来
# 将档名存成 uninstall_perl_module.pluse 5.14.2;use ExtUtils::Installed;use ExtUtils::Packlist;# Exit unless a module name was passeddie ("Error: no Module::Name passed as an argument. E.G.\n\t perl $0 Module::Name\n") unless $#ARGV == 0;my $module = shift @ARGV;my $installed_modules = ExtUtils::Installed->new;# iterate through and try to delete every file associated with the moduleforeach my $file ($installed_modules->files($module)) { print "removing $file\n"; unlink $file or warn "could not remove $file: $!\n";}# delete the module packfilemy $packfile = $installed_modules->packlist($module)->packlist_file;print "removing $packfile\n";unlink $packfile or warn "could not remove $packfile: $!\n";# delete the module directories if they are emptyforeach my $dir (sort($installed_modules->directory_tree($module))) { print("removing $dir\n"); rmdir $dir or warn "could not remove $dir: $!\n";}
然後自己执行:
perl uninstall_perl_module.pl 你想::移除的::模块
到 perl 的安装目录下, 找 /site/lib , 里面每一个 .pm 的档就是一个你自己安装下去的模块
没有一个预设的方式去移除模块, 但你可以写下面这个程序, 然後存起来
# 将档名存成 uninstall_perl_module.pluse 5.14.2;use ExtUtils::Installed;use ExtUtils::Packlist;# Exit unless a module name was passeddie ("Error: no Module::Name passed as an argument. E.G.\n\t perl $0 Module::Name\n") unless $#ARGV == 0;my $module = shift @ARGV;my $installed_modules = ExtUtils::Installed->new;# iterate through and try to delete every file associated with the moduleforeach my $file ($installed_modules->files($module)) { print "removing $file\n"; unlink $file or warn "could not remove $file: $!\n";}# delete the module packfilemy $packfile = $installed_modules->packlist($module)->packlist_file;print "removing $packfile\n";unlink $packfile or warn "could not remove $packfile: $!\n";# delete the module directories if they are emptyforeach my $dir (sort($installed_modules->directory_tree($module))) { print("removing $dir\n"); rmdir $dir or warn "could not remove $dir: $!\n";}
然後自己执行:
perl uninstall_perl_module.pl 你想::移除的::模块
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯