Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi I'm a complete noob to perl so excuse my ignorance on this. I'm trying to install a mass script with a few deps but when I do sudo perl -MCPAN -e 'install Convert::Bencode' (or any module) it goes to install it into a users directory that doesnt exist anymore. The user is no longer on the system and his account has been completely wiped. So why is it still trying to install it. And How can i change it to default. I'm running Ubuntu 10.04 Lucid and have sudo as its my server. I know the user was playing around with perl at the time and shouldnt have been and has managed to set the module dir to his name IE /home/mokki/.cpan/ when i want it going to either mine /home/desktop or root. what do i need to reinstall in my name and configure. ? Thanks Will

Replies are listed 'Best First'.
Re: Problem with CPAN install dir
by Khen1950fx (Canon) on Jun 05, 2011 at 00:56 UTC
    That's easy to fix. Go into the cpan shell:
    cpan> o conf init cpan_home cpan> <cpan_home> CPAN build and cache directory? [/root/.cpan] <ENTER> cpan> o conf commit <ENTER>
      Thx. Worked a treat