Montgomery Township, New Jersey

User CPAN installation broken

Programming, Code, Coding, Programmer, Javascript
Here is a workaround for a common problem. You do not have root access the *NIX server to configure perl but want to install perl libraries. Normally the user can use CPAN with local libraries (PERL5LIB).

But sometimes CPAN gets confused and you get an error like this:

Your configuration suggests "/root/.cpan" as your CPAN.pm working directory. I could not create this directory due to this error:
mkdir /root/.cpan: Permission denied at /data/eva/perl/lib/perl5/site_perl/5.8.0/CPAN.pm line 552

I search around on Google and found this solution:

Execute the following procedure (it worked for me, though I am not sure if all steps are necessary):

  • Create a directory for the perl modules in your HOME $ mkdir ~/perl5lib
  • Create ~/.cpan and ~/.cpan/CPAN directories: $ mkdir ~/.cpan $ mkdir ~/.cpan/CPAN
  • Create a Config.pm for the CPAN module with $CPAN::Config empty $ echo "\$CPAN::Config = {}" > ~/.cpan/CPAN/MyConfig.pm
  • Execute again: $ perl -MCPAN -e shell

This time (if all goes well) it will prompt you for the empty fields in $CPAN::Config.

User CPAN installation broken %name

Husband, father, Information security professional and avid photographer living at the junction of Princeton Township, Montgomery Township and Rocky Hill.

Liked this post? Follow this blog to get more. 

One Comment on “User CPAN installation broken

Mentions

  • Khürt Williams

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: