适用场景:不具备root权限且没有sudo权限的普通用户安装perl module
安装步骤:
1)删除/.cpan/.lock
rm -rf /home/users/.cpan/.lock
2)进入cpan交互模式
perl -MCPAN -e shell
Terminal does not support AddHistory.
cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.
cpan[1]> o conf mbuildpl_arg "--install_base /home/USER/extra_lib/"
mbuildpl_arg [--install_base /home/USER/extra_lib/]
Please use 'o conf commit' to make the config permanent!
cpan[2]> o conf makepl_arg "PREFIX=/home/USER/extra_lib/"
makepl_arg [PREFIX=/home/USER/extra_lib/]
Please use 'o conf commit' to make the config permanent!
cpan[3]> install JSON