5.6 to 5.8 CPAN help

  • Thread starter The King of Pots and Pans
  • Start date
T

The King of Pots and Pans

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I had RH7.2 with Perl 5.6 on my machine. I learned a little about CPAN
a long time ago and remember using it to get modules at one time. I
haven't used it in a long, long, long while.

Since then I have upgraded to RH9, which apparently has Perl 5.8. I
wanted to get the DB_File module the other day and typed "cpan" at my
linux prompt, not remember how exactly to invoke it or how it works.

I get the following error:
[steve@sol 5.8.0]$ cpan
Can't locate CPAN.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .)
at /usr/bin/cpan line 6.
BEGIN failed--compilation aborted at /usr/bin/cpan line 6.

I did a locate on CPAN.pm and got the following:
[steve@sol steve]$ locate CPAN.pm
/var/www/html/perlpods/CPAN.pm.html
/usr/lib/perl5/5.6.0/Bundle/CPAN.pm
/usr/lib/perl5/5.8.0/CPAN.pm.links
/usr/local/lib/perl5/5.6.1/CPAN.pm
[steve@sol steve]$

I am unsure of how to proceed. I went to the cpan website and tried
finding information on how to install cpan, or get it working... but
was unable to find anything to address this issue.

Anyone have any idea what might be going on and what course of action
I should take to get cpan working with 5.8?

I am thinking it probably isn't a good idea just to copy the 5.6 cpan
module into the 5.8 directory and try to use it?

- --
The King of Pots and Pans
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAhMy3d/wbFEGfmloRAiv9AJ9xuSmaN6hJGrpP0mp5vhBf9Mh0dACeI0qn
wxTWHoJqWaOq6iGku+UBKus=
=/j4o
-----END PGP SIGNATURE-----
 
W

Walter Roberson

:I had RH7.2 with Perl 5.6 on my machine. I learned a little about CPAN
:a long time ago and remember using it to get modules at one time. I
:haven't used it in a long, long, long while.

perl -MCPAN -e shell
 
T

The King of Pots and Pans

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

:I had RH7.2 with Perl 5.6 on my machine. I learned a little about
CPAN :a long time ago and remember using it to get modules at one
time. I :haven't used it in a long, long, long while.
perl -MCPAN -e shell

Thanks. As user 'steve' that at least did something. I went through
the setup and finally typed "install Net::FTP" and "install
Bundle::CPAN" as it suggested. During the process I got a bunch of
errors about "you do not have permissions to install this" and a lot
of "not found in @INC path" type stuff.

I tried su'ing to root and running the command above you
suggested. But got the original bad @INC path thing:

[root@sol root]# perl -MCPAN -e shell
Can't locate CPAN.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .).
BEGIN failed--compilation aborted.
[root@sol root]#

Also, in what documentation does one find that "perl -MCPAN -e shell"
kicks off everything? I looked and looked and looked but couldn't find
how to "start it."

- --
The King of Pots and Pans
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAhNUxd/wbFEGfmloRAt84AJ0ZFK953Txd0QoKhyJAHtk7igMGjwCgsi9M
XDjPLzcHleGw/E/um+AVH6A=
=9+I9
-----END PGP SIGNATURE-----
 
T

The King of Pots and Pans

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

perl -MCPAN -e shell

When I attempt to install things using the above it installs them in
the perl 5.6 dirs. How do I start using the perl 5.8 and configure
cpan for perl 5.8?

My whole point here is to use cpan to get DB_File because spamassassin
won't let me use the sa-learn program until DB_File module is
installed. I believe I was able to install DB_File using CPAN just
fine, but sa-learn -D still believes it is not installed.

??


- --
The King of Pots and Pans
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAhNiwd/wbFEGfmloRArkEAJ9c0BWGDf7GidvCiU7FbgNiwNXA9QCfeO4g
xouS2fovtfL6GGhJDaRb0/I=
=GNcU
-----END PGP SIGNATURE-----
 
W

Walter Roberson

:> perl -MCPAN -e shell

:When I attempt to install things using the above it installs them in
:the perl 5.6 dirs. How do I start using the perl 5.8 and configure
:cpan for perl 5.8?

perl5.8 -MCPAN -e shell

CPAN knows about which version of perl you are running, and will
install under the appropriate hierarchy.
 
W

Walter Roberson

:I tried su'ing to root and running the command above you
:suggested. But got the original bad @INC path thing:

:[root@sol root]# perl -MCPAN -e shell
:Can't locate CPAN.pm in @INC (@INC contains:
:/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
:/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
:/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
:/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
:/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
:/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .).

Notice the . just before the closing bracket. That dot indicates
the current directory will be examined. So just CD to a directory
that has CPAN.pm in it, and try again. (You might have to then
tell CPAN to install CPAN so it gets stuffed in the expected location...)

As for how to know that this was the way to invoke CPAN:

$ perldoc -m CPAN
[.... lots and lots of code to scroll through]
=head1 NAME

CPAN - query, download and build perl modules from CPAN sites

=head1 SYNOPSIS

Interactive mode:

perl -MCPAN -e shell;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,818
Messages
2,569,732
Members
45,691
Latest member
Dick331194

Latest Threads

Top