I was trying to install a module in my own directory via cpan (tried with perl 5.16.3 on CentOS 7; perl 5.30.0 on FreeBSD 12) but failed because install process tried to install Text::Table and Text::Aligner dependencies in a system wide directory (/usr/local) not writable by me as a lowly non-root user.
I had checked that the right directory had been specified for both Build.PL & Makefile.PL. What am I missing in the CPAN configuration file?
cpan[2]> o conf /make|build|install/
$CPAN::Config options from /home/parv/.cpan/CPAN/MyConfig.pm:
build_cache [100]
build_dir [/home/parv/.cpan/build]
build_dir_reuse [0]
build_requires_install_policy [yes]
cleanup_after_install undef
make [/usr/bin/make]
make_arg []
make_install_arg [PREFIX=/home/parv/test-perl5]
make_install_make_command [/usr/bin/make]
makepl_arg [PREFIX=/home/parv/test-perl5]
mbuild_arg [--install_base /home/parv/test-perl5]
mbuild_install_arg []
mbuild_install_build_command [./Build]
mbuildpl_arg []
prefer_installer [MB]
# cpan client - FAILED on CentOS & FreeBSD.
.
.
.---- JETTERO/Term-ANSIColorx-ColorNicknames-2.7191.tar.gz ----
Text::Table [requires]
Running install for module 'Text::Table'
.
.
.
Building Text-Table
SHLOMIF/Text-Table-1.133.tar.gz
./Build --install_base /home/parv/test-perl5 --prefix /home/parv/tes
+t-perl5 --install_base /home/parv/test-perl5 --prefix /home/parv/test
+-perl5 -- OK
Running Build test for SHLOMIF/Text-Table-1.133.tar.gz
.
.
.
Result: PASS
SHLOMIF/Text-Table-1.133.tar.gz
./Build test -- OK
Running Build install for SHLOMIF/Text-Table-1.133.tar.gz
Building Text-Table
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!
ERROR: Can't create '/usr/local/lib/perl5/site_perl/Text'
mkdir /usr/local/lib/perl5/site_perl/Text: Permission denied at /usr/l
+ocal/lib/perl5/5.30/ExtUtils/Install.pm line 489.
# Manually issued command - SUCCEEDED on FreeBSD (hadn't tried on Cent
+OS yet).
perl Build.PL --install_base /home/parv/test-perl5/ && ./Build && ./Bu
+ild test && ./Build install
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Text-Table' version '1.133'
Building Text-Table
.
.
.
Result: PASS
Building Text-Table
Installing /home/parv/test-perl5/lib/perl5/Text/Table.pm
Installing /home/parv/test-perl5/man/man3/Text::Table.3