{"id":94,"date":"2014-06-13T10:16:19","date_gmt":"2014-06-13T08:16:19","guid":{"rendered":"https:\/\/www.timk.de\/it-blog\/?p=94"},"modified":"2014-06-13T13:39:20","modified_gmt":"2014-06-13T11:39:20","slug":"uninstall-perl-cpan-module","status":"publish","type":"post","link":"https:\/\/www.timk.de\/it-blog\/uninstall-perl-cpan-module\/","title":{"rendered":"Uninstall Perl CPAN Module"},"content":{"rendered":"<p>Via pm-uninstall<\/p>\n<pre># Install pm-uninstall at the frist time \/ if not already exists\r\nperl -MCPAN -e \"install App::pm-uninstall\"\r\n#Uninstall Module example Net::SSLeay\r\npm-uninstall -n Net::SSLeay<\/pre>\n<p>Or use follwing script<br \/>\ntarget=&#8221;_blank&#8221;>https:\/\/perltricks.com\/article\/3\/2013\/3\/27\/How-to-cleanly-uninstall-a-Perl-module:<\/a><\/p>\n<pre># uninstall_perl_module.pl from PerlTricks.com\r\n\r\nuse 5.14.2;\r\nuse ExtUtils::Installed;\r\nuse ExtUtils::Packlist;\r\n\r\n# Exit unless a module name was passed\r\ndie (\"Error: no Module::Name passed as an argument. E.G.\\n\\t perl $0 Module::Name\\n\") unless $#ARGV == 0;\r\n\r\nmy $module = shift @ARGV;\r\n\r\nmy $installed_modules = ExtUtils::Installed-&gt;new;\r\n\r\n# iterate through and try to delete every file associated with the module\r\nforeach my $file ($installed_modules-&gt;files($module)) {\r\n print \"removing $file\\n\";\r\n unlink $file or warn \"could not remove $file: $!\\n\";\r\n}\r\n\r\n# delete the module packfile\r\nmy $packfile = $installed_modules-&gt;packlist($module)-&gt;packlist_file;\r\nprint \"removing $packfile\\n\";\r\nunlink $packfile or warn \"could not remove $packfile: $!\\n\";\r\n\r\n# delete the module directories if they are empty\r\nforeach my $dir (sort($installed_modules-&gt;directory_tree($module))) {\r\n print(\"removing $dir\\n\");\r\n rmdir $dir or warn \"could not remove $dir: $!\\n\";\r\n}<\/pre>\n<p>[Found at <a title=\"https:\/\/perltricks.com\/article\/3\/2013\/3\/27\/How-to-cleanly-uninstall-a-Perl-module\" href=\"https:\/\/perltricks.com\/article\/3\/2013\/3\/27\/How-to-cleanly-uninstall-a-Perl-module\" ]\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Via pm-uninstall # Install pm-uninstall at the frist time \/ if not already exists perl -MCPAN -e &#8220;install App::pm-uninstall&#8221; #Uninstall Module example Net::SSLeay pm-uninstall -n Net::SSLeay Or use follwing script target=&#8221;_blank&#8221;>https:\/\/perltricks.com\/article\/3\/2013\/3\/27\/How-to-cleanly-uninstall-a-Perl-module: # uninstall_perl_module.pl from PerlTricks.com use 5.14.2; use ExtUtils::Installed; use ExtUtils::Packlist; # Exit unless a module name was passed die (&#8220;Error: no Module::Name passed as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-94","post","type-post","status-publish","format-standard","hentry","category-perl"],"_links":{"self":[{"href":"https:\/\/www.timk.de\/it-blog\/wp-json\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.timk.de\/it-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.timk.de\/it-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.timk.de\/it-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.timk.de\/it-blog\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":3,"href":"https:\/\/www.timk.de\/it-blog\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":100,"href":"https:\/\/www.timk.de\/it-blog\/wp-json\/wp\/v2\/posts\/94\/revisions\/100"}],"wp:attachment":[{"href":"https:\/\/www.timk.de\/it-blog\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.timk.de\/it-blog\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.timk.de\/it-blog\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}