Category: | Utility Scripts |
Author/Contact Info | Casiano |
Description: | Remove a installed Perl distribution |
use strict; use ExtUtils::Packlist; use ExtUtils::Installed; use List::Util qw(first); $ARGV[0] or die "Usage: $0 Module::Name\n"; my $mod = $ARGV[0]; die "Does not looks like a module name" unless $mod =~ m{\w+(::\w+)*}; my $inst = ExtUtils::Installed->new(); die "Can't find module $mod using .packlist files\n" unless first { /$mod/ } ( $inst->modules ); foreach my $item ( sort( $inst->files($mod) ) ) { print "removing $item\n"; unlink $item or warn "Can't remove $item try by hand!\n"; } my $packfile = $inst->packlist($mod)->packlist_file(); print "removing $packfile\n"; unlink $packfile or warn "Can't remove $packfile try by hand!\n"; =head1 NAME pmrm -- remove installed perl distribution module =head1 SYNOPSIS pmrm Some::Module |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Remove an Installed Module
by bingos (Vicar) on Oct 14, 2008 at 08:48 UTC | |
Re: Remove an Installed Module
by CountZero (Bishop) on Oct 14, 2008 at 06:22 UTC | |
Re: Remove an Installed Module
by Tux (Canon) on Oct 14, 2008 at 12:06 UTC | |
Re: Remove an Installed Module
by hackman (Acolyte) on Jan 27, 2011 at 08:58 UTC | |
by Anonymous Monk on Jan 27, 2011 at 12:57 UTC | |
by hackman (Acolyte) on Feb 11, 2011 at 20:36 UTC |