Hello,
On Mon, 29 Aug 2011, Andi Sugandi wrote:
I'm going to test newest perl-SMS-Send package from
devel:languages:perl repository so the solved issue of BNC#712352 will
work for me too, but I already have this module installed* by CPAN
beforehand.
So how to remove kind of this Perl module?
Thanks in advance.
If it was installed with ExtUtils::MakeMaker, RTFM:
'man ExtUtils::Installed'. Or just try:
,----[ perluninstall.pl ]
| #!/usr/bin/perl
| ### nope, no '-w', we 'use warnings' later.
| #
| ### Copyright (c)2004 David Haller
| ### This program is free software; you can redistribute it and/or
| ### modify it under the same terms as Perl itself.
|
| use strict;
| use ExtUtils::Installed;
|
| # we don't want to die, if some module is not installed, we want to
| # continue with the next module, therefore we redefine croak which
| # ExtUtils::Installed calls in that case.
| sub Carp::croak { print STDERR, @_, "\n"; return 1; }
|
| use warnings;
| use ExtUtils::Install;
| use File::Basename;
|
| my $verbose = 1;
| my $test = 0;
| my @MODULES;
| my $USAGE ="Usage: " . basename($0)
| . " [--test] [--quiet] [--help] MODULE ...\n";
|
| die "$USAGE" if($#ARGV < 0);
|
| foreach(@ARGV) {
| if(/^--test$/) {
| $test = 1;
| } elsif(/^--quiet$/) {
| $verbose = 0;
| } elsif(/^--help$/) {
| print "$USAGE";
| exit(0);
| } elsif(/^-/) {
| die "Unknown option $_\n$USAGE";
| } else {
| push @MODULES, $_;
| }
| }
| die "$USAGE" if $#MODULES < 0;
|
| my $installed = new ExtUtils::Installed;
|
| print "==== test mode ====\n" if $test;
|
| foreach my $module (@MODULES) {
| print "\n";
| my $version = $installed->version($module) or next;
| print "Found module $module, version $version\n";
| print "do you want to uninstall this module? [y/N] ";
| my $r = <STDIN>; chomp($r);
| if($r && $r =~ /^y/i) {
| my $pl = $installed->packlist($module)->packlist_file();
| uninstall($pl, $verbose, $test);
| }
| }
| 1;
| __END__
`----
HTH,
-dnh
--
Coffee not found: user halted
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org