<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Uninstall a perl module !]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/41424/uninstall-a-perl-module?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/41424/uninstall-a-perl-module?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/41424/uninstall-a-perl-module</guid>
	<pubDate>Fri, 13 Mar 2020 05:41:10 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/41424/uninstall-a-perl-module</link>
	<title><![CDATA[Uninstall a perl module !]]></title>
	<description><![CDATA[<code># 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 (&quot;Error: no Module::Name passed as an argument. E.G.\n\t perl $0 Module::Name\n&quot;) unless $#ARGV == 0;

my $module = shift @ARGV;

my $installed_modules = ExtUtils::Installed-&gt;new;

# iterate through and try to delete every file associated with the module
foreach my $file ($installed_modules-&gt;files($module)) {
    print &quot;removing $file\n&quot;;
    unlink $file or warn &quot;could not remove $file: $!\n&quot;;
}

# delete the module packfile
my $packfile = $installed_modules-&gt;packlist($module)-&gt;packlist_file;
print &quot;removing $packfile\n&quot;;
unlink $packfile or warn &quot;could not remove $packfile: $!\n&quot;;

# delete the module directories if they are empty
foreach my $dir (sort($installed_modules-&gt;directory_tree($module))) {
    print(&quot;removing $dir\n&quot;);
    rmdir $dir or warn &quot;could not remove $dir: $!\n&quot;;
}

#Run
#perl uninstall_perl_module.pl Bio::SCF</code>]]></description>
	<dc:creator>BioStar</dc:creator>
</item>

</channel>
</rss>