In trying to use CPAN on SDF systems, there are two problems to overcome.
This is solved by bootstrapping local::lib and setting up CPAN so that it uses a directory under /tmp to do its work.
cd /tmp
wget https://cpan.metacpan.org/authors/id/H/HA/HAARG/local-lib-2.000029.tar.gz
tar zxvf local-lib-2.000029.tar.gz
cd local-lib-2.000029
perl Makefile.PL --bootstrap
eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"
perl -MCPAN -e shell
o conf build_dir /tmp/username-cpan-build
o conf commit
(Replace "username" with your own username so that your build directory doesn't collide with another user's build directory.)
eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"
export PATH="$HOME/perl5/bin:$PATH"
# Run the CPAN shell
perl -MCPAN -e shell
# Run the CPAN shell (assuming your PATH is setup right)
cpan
# See what modules you've installed locally.
tree $HOME/perl5/lib/perl5
# See what scripts were installed locally.
ls -l $HOME/perl5/bin