Removing .cpan Directory

M

mmccaws2

What happens if one remove .cpan directory in the home directory. I'm
locked out of the perl shell, reinstalled perl, and still can't
perl -e shell

This symptom seems to have isolated the problem to my configuration.

Mike
 
R

Ron Bergin

What happens if one remove .cpan directory in the home directory. I'm
locked out of the perl shell, reinstalled perl, and still can't
perl -e shell

This symptom seems to have isolated the problem to my configuration.

Mike

Do you mean the cpan shell?

try

perl -MCPAN -e shell
 
M

mmccaws2

Do you mean the cpan shell?w

try

perl -MCPAN
When I try that command and similar ones, I'm rejected. So I thought
perl was corrupted. But after reinstalling perl, I still can't log
into the shell. Error messages reflect a module install error output
that I was doing when my connection got disrupted.

So if you reinstall perl and the only thing that stay the same, I
believe, is that .cpan directory in my home directory. You know /home/
username/.cpan. So I'm thinking about either blowing away my .cpan
directory and see if that makes a difference.

Does anyone know what should happen?

Mike
 
M

mmccaws2

That depends. If you normally run CPAN as root, then it stores its config
info (mirror locations, etc) in the global CPAN/Config.pm module, and the
only thing in .cpan will be downloaded tarballs, build trees, and so forth;
in other words, nothing critical.

If you don't run CPAN as root, then the config params are stored in .cpan/
CPAN/MyConfig.pm instead. This could be the case if you use CPAN to install
modules in your home directory, or if you're using a newer CPAN.pm that lets
you limit root authority to just the final "sudo make install".

If you want to "reset" CPAN, and if it's using a global CPAN::Config.pm,
then it might not be a bad idea to delete that too. CPAN::MyConfig.pm, of
course, lives under .cpan, so deleting the directory will catch it too.

After that, CPAN should prompt you to go through the initial configuration
steps again, setting up the default Makefile.PL arguments, choosing mirrors,
etc. And because you've deleted the cached info, it will fetch fresh copies
of its module and author indexes.

sherm--

There was a CPAN.pm file. I removed that. Now I see

mkdir /home/mcca/.cpan/CPAN: Permission denied at /opt/perl_32/lib/
5.8.8/CPAN/HandleConfig.pm line 529

It looks like there is some setting to make sure non sudo users can't
use perl -MCPAN -e shell

Which means that my co developers will not be able to use, I could be
wrong. How do I change that?

Also

I just installed the latest CPAN.pm, the last line says

'YAML' not installed, will not store persistent state.

what is this doing?

Mike

Mike
 
M

mmccaws2

There was a CPAN.pm file. I removed that. Now I see

mkdir /home/mcca/.cpan/CPAN: Permission denied at /opt/perl_32/lib/
5.8.8/CPAN/HandleConfig.pm line 529

It looks like there is some setting to make sure non sudo users can't
use perl -MCPAN -e shell

Which means that my co developers will not be able to use, I could be
wrong. How do I change that?

Also

I just installed the latest CPAN.pm, the last line says

'YAML' not installed, will not store persistent state.

what is this doing?

Mike

Mike

Lessons learned:

if you can't get into a perl shell from perl -MCPAN it may be from
the .cpan/CPAN.pm file. So you may not need to reinstall perl
The question I have is -- what commands are there to test a perl
configuration as appose to test a perl -MCPAN -e shell problem?
Anyone have a link to address this?

Well thanks everyone.

Mike
 
M

mmccaws2

There is no such thing. You need root privileges if you're installing
modules in a directory for which such privs are needed - but that has
nothing at all to do with CPAN.

sherm--

Thanks

I realize i keep calling it a shell, only since it gives you a 'shell'
like prompt (>). So I'm obviously calling it a shell is incorrect.
Once perl was rebuilt, this is hpux so I think what was actually done
was the latest Perl binary version for that OS version was installed,
my .cpan directory was unchanged, as you would expect. So I still got
error messages using $perl -MCPAN -e shell similar to those posted
before and then bumped out to the normal Posix shell. Now since my
cpan configuration hadn't changed and my perl installation did, the
next thing that I could figure was it had something to do with my
configuration. So, I ask the community, then blew away my cpan.pm.
I've reinstalled the modules I needed and I'm back enjoying putting
together my programs.

I realize that now I have a new perl installation I can't go back to
analyze what went wrong. Can you suggest how cpan.pm could lock up my
access to perl -MCPAN -e shell? Should I be looking for other
problems developing??

let me know.

Mike
 

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,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top