Skip to content

How to remove install CPAN modules?

How to remove install CPAN modules?

Answer:

1. Copy the script below, e.g. remove_module.pl

#!/usr/bin/perl -w 

use ExtUtils::Packlist;
use ExtUtils::Installed; 

$ARGV[0] or die "Usage: $0 Module::Name\n"; 

my $module = $ARGV[0]; 

my $inst = ExtUtils::Installed->new(); 

foreach my $item (sort($inst->files($module))) {
    print "Removing $item\n";
    unlink $item;
} 

my $packfile = $inst->packlist($module)->packlist_file();
print "Removing $packfile\n";
unlink $packfile;

2. Execute the script to remove module, e.g. MongoDB

# perl remove_module.pl MondoDB

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  1. Install Perl module from CPAN even tests failed
  2. Install Perl module using CPAN
  3. List all the installed Perl modules
  4. Read command line arguments in Perl
  5. How to check if a Perl module is already installed?

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*