A
amirkarger
Hi.
Our sysadmin installs a bunch of Perl stuff using CPAN.pm. I decided to
try and use CPAN.pm today, but I got 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
/usr/local/lib/perl5/5.8.6/CPAN.pm line 553
In retrospect, that's not so surprising. CPAN::Config.pm says:
'cpan_home' => q[/root/.cpan],
Obviously I'm not allowed to write to there, but CPAN::Config.pm is
where CPAN.pm assumes it should put stuff unless you tell it otherwise
in ~/.cpan/CPAN/MyConfig.pm.
So here's my question: is it generally better to create a MyConfig.pm
before using CPAN.pm, or can we write
'cpan_home' => "$ENV{HOME}/.cpan"
(and do the same to build_dir etc.)?
The former solution requires every user who wants to use CPAN.pm to
create a .cpan before running cpan. More likely, they'll just decide
CPAN's not working. So I prefer the latter. Is there anything wrong
with using ENV{HOME}? How do other people handle this situation?
-Amir Karger
Our sysadmin installs a bunch of Perl stuff using CPAN.pm. I decided to
try and use CPAN.pm today, but I got 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
/usr/local/lib/perl5/5.8.6/CPAN.pm line 553
In retrospect, that's not so surprising. CPAN::Config.pm says:
'cpan_home' => q[/root/.cpan],
Obviously I'm not allowed to write to there, but CPAN::Config.pm is
where CPAN.pm assumes it should put stuff unless you tell it otherwise
in ~/.cpan/CPAN/MyConfig.pm.
So here's my question: is it generally better to create a MyConfig.pm
before using CPAN.pm, or can we write
'cpan_home' => "$ENV{HOME}/.cpan"
(and do the same to build_dir etc.)?
The former solution requires every user who wants to use CPAN.pm to
create a .cpan before running cpan. More likely, they'll just decide
CPAN's not working. So I prefer the latter. Is there anything wrong
with using ENV{HOME}? How do other people handle this situation?
-Amir Karger