https://github.com/NBISweden/AGAT
Raw File
Tip revision: b353aee3830fd5b10b9a590dc69fdecfb5c51d7b authored by Jacques Dainat on 10 March 2020, 21:59:37 UTC
Merge pull request #29 from NBISweden/0.2.0
Tip revision: b353aee
uninstall_AGAT
#usage: perl uninstall_AGAT
use 5.14.2;
use ExtUtils::Installed;
use ExtUtils::Packlist;

my $module = "AGAT";

my $installed_modules = ExtUtils::Installed->new;

# iterate through and try to delete every file associated with the module
foreach my $file ($installed_modules->files($module)) {
    unlink $file or warn "could not remove $file: $!\n";
}

# delete the module packfile
my $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 empty
foreach my $dir (sort($installed_modules->directory_tree($module))) {
    print("removing $dir\n");
    rmdir $dir or warn "could not remove $dir: $!\n";
}
back to top