Newbie CPAN issue

[email protected] ("Marc Suttle")
Newsgroups perl.cpan.discuss
Message-ID <[email protected]>
Hello list,
	I recently was trying to mess around with CPAN and have seemed
to get myself into a bind.

System- OpenBSD 3.8

The are two scripts I was messing with:

List-modules.pl:
-------------------------------------------------
#!/usr/local/bin/perl

use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
foreach my $module ($instmod->modules()) {
my $version = $instmod->version($module) || "???";
       print "$module -- $version\n";
}

-------------------------------------------------
And

Remove-modules.pl:

-------------------------------------------------
#!/usr/local/bin/perl -w

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

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

my $mod = $ARGV[0]; 

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

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

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

On a default install:

# perl list-modules.pl
Perl -- 5.8.6

On the system I was messing with:

Can't locate Cwd.pm in @INC (@INC contains:
/usr/libdata/perl5/i386-openbsd/5.8.6
/usr/local/libdata/perl5/i386-openbsd/5.8.6 /usr/libdata/perl5
/usr/local/libdata/perl5 /usr/local/libdata/perl5/site_perl/i386-openbsd
/usr/libdata/perl5/site_perl/i386-openbsd
/usr/local/libdata/perl5/site_perl /usr/libdata/perl5/site_perl
/usr/local/lib/perl5/site_perl .) at
/usr/libdata/perl5/ExtUtils/MakeMaker.pm line 162.
BEGIN failed--compilation aborted at
/usr/libdata/perl5/ExtUtils/MakeMaker.pm line 162.
Compilation failed in require at
/usr/libdata/perl5/ExtUtils/Installed.pm line 7.
BEGIN failed--compilation aborted at
/usr/libdata/perl5/ExtUtils/Installed.pm line 7.
Compilation failed in require at list-modules.pl line 3.
BEGIN failed--compilation aborted at list-modules.pl line 3.

As you can see I deleted the Cwd.pm module because I was trying to
remove all the modules I had added to get it back to the original state.

So...a couple of questions:

1. How do I fix Cwd.pm error?

2. Why did removing the Cwd.pm module kill cpan?

3. Once Cwd.pm is installed as a module can you remove it?  How do I
remove all modules I have installed to get it back to original state?

4.  All I wanted to do was install two modules: Digest::SHA1 and
MIME::Base64 and it kept complaining about bad cheksums.  Then I even
tried a cpan> install Bundle::CPAN and it returns:

"Distribution id = G/GB/GBARR/Bundle-libnet-1.00.tar.gz
    CPAN_USERID  GBARR (Graham Barr <[email protected]>)
    CONTAINSMODS
    MD5_STATUS
    localfile
/root/.cpan/sources/authors/id/G/GB/GBARR/Bundle-libnet-1.00.tar.gz

I'd recommend removing
/root/.cpan/sources/authors/id/G/GB/GBARR/Bundle-libnet-1.00.tar.gz. Its
MD5
checksum is incorrect. Maybe you have configured your 'urllist' with
a bad URL. Please check this array with 'o conf urllist', and
retry."

Thanks for the help.  I would prefer not to reinstall anything as this
is a production server.


Thanks,

Marc Suttle
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.