Installing CPAN modules

software development


I’m having an awful lot of trouble installing CPAN modules, specifically WWW::Contact.
I have the following set int my ~/.profile -

export PERL5LIB

and the following in my cpan config -

cpan[7]> o conf
$CPAN::Config options from ‘/home/bakerjay/.cpan/CPAN/’:
commit [Commit changes to disk]
defaults [Reload defaults from disk]
help [Short help about ‘o conf’ usage]
init [Interactive setting of all options]

applypatch         undef
auto_commit        [1]
build_cache        [50]
build_dir          [/home/bakerjay/.cpan/build]
build_dir_reuse    undef
build_requires_install_policy undef
bzip2              undef
cache_metadata     [1]
check_sigs         undef
colorize_debug     undef
colorize_output    undef
colorize_print     undef
colorize_warn      undef
commandnumber_in_prompt [1]
commands_quote     undef
cpan_home          [/home/bakerjay/.cpan]
curl               undef
dontload_hash      undef
dontload_list      undef
ftp                []
ftp_passive        [1]
ftp_proxy          []
getcwd             [cwd]
gpg                [/usr/bin/gpg]
gzip               [/bin/gzip]
histfile           [/home/bakerjay/.cpan/histfile]
histsize           [1000]
http_proxy         []
inactivity_timeout [0]
index_expire       [1]
inhibit_startup_message [0]
keep_source_where  [/home/bakerjay/.cpan/sources]
load_module_verbosity undef
lynx               [/usr/bin/lynx]
make               [/usr/bin/make]
make_arg           []
make_install_arg   []
make_install_make_command [/usr/bin/make]
makepl_arg         [PREFIX=/home/bakerjay/perl_modules]
mbuild_arg         [PREFIX=/home/bakerjay/perl_modules]
mbuild_install_arg []
mbuild_install_build_command [./Build]
mbuildpl_arg       [PREFIX=/home/bakerjay/perl_modules]
ncftp              undef
ncftpget           [/usr/bin/ncftpget]
no_proxy           []
pager              [/usr/bin/less]
password           undef
patch              undef
prefer_installer   undef
prefs_dir          undef
prerequisites_policy [follow]
proxy_pass         undef
proxy_user         undef
randomize_urllist  undef
scan_cache         [atstart]
shell              [/bin/bash]
show_unparsable_versions undef
show_upload_date   [0]
show_zero_versions undef
tar                [/bin/tar]
tar_verbosity      undef
term_is_latin      [1]
term_ornaments     [1]
test_report        undef
unzip              [/usr/bin/unzip]
    0 []
    1 []
use_sqlite         [0]
username           undef
wait_list          undef
wget               [/usr/bin/wget]
yaml_load_code     undef
yaml_module        undef

Any ideas as to what I’m doing wrong would be much appreciated.



The makepl_arg, mbuild_arg, and mbuildpl_arg you have set are incorrect, and will end up trying to install files to the wrong location. The correct settings are:

makepl_arg => INSTALL_BASE=/home/username/perl mbuild_install_arg => install_base=/home/username/perl

All the other similar variables should be unset. However, you may have better luck overall using cpanminus to install Perl modules – it’s considerably faster, and has configuration options built in for installing to your home directory.


Hew, thanks very much Andrew.

cpanminus worked like a charm - and so much quicker than cpan. Brilliant!