cpanm是一个新型的perl包管理器,相对于cpan,以及cpanplus,cpanm安装使用极其简便,是perl包管理器中的一股清流。
安装cpanm:
cd ~/bin curl -L https://cpanmin.us/ -o cpanm chmod +x cpanm
使用说明:
# cpanm -h -v,--verbose Turns on chatty output -q,--quiet Turns off the most output --interactive 开启交互配置(required for Task:: modules) -f,--force 强制安装 -n,--notest Do not run unit tests --test-only 只测试不安装 -S,--sudo sudo to run install commands --installdeps 只安装依赖模块 --showdeps 只显示依赖信息 --reinstall 重新安装 --mirror 指定镜像url (e.g. http://cpan.cpantesters.org/) --mirror-only 只从镜像下载 --prompt Prompt when configure/build/test fails -l,--local-lib Specify the install base to install modules -L,--local-lib-contained Specify the install base to install all non-core modules --self-contained Install all non-core modules, even if they're already installed. --auto-cleanup Number of days that cpanm's work directories expire in. Defaults to 7 Examples: cpanm Test::More # install Test::More cpanm MIYAGAWA/Plack-0.99_05.tar.gz # full distribution path cpanm http://example.org/LDS/CGI.pm-3.20.tar.gz # install from URL cpanm ~/dists/MyCompany-Enterprise-1.00.tar.gz # install from a local file cpanm --interactive Task::Kensho # Configure interactively cpanm . # install from local directory cpanm --installdeps . # install all the deps for the current directory cpanm -L extlib Plack # install Plack and all non-core deps into extlib cpanm --mirror http://cpan.cpantesters.org/ DBI # use the fast-syncing mirror
使用:后面直接接需要安装的包名即可
cpanm CGI::Session cpanm Template
为了加快 cpanm 下载速度, 可以指定使用镜像. 并只从镜像下载
cpanm --mirror https://mirrors.163.com/cpan --mirror-only -l /share/soft/perl_lib Bio::Perl
注:–mirror 使用163镜像
–mirror-only 只使用指定镜像
-l /share/soft/perl_lib 指定包安装的位置,类似于perl Makefile.PL PREFIX=/home/yangl/perl_lib中的PREFIX
https://github.com/miyagawa/cpanminus
https://blog.csdn.net/memray/article/details/17543845
http://www.jb51.net/article/56286.htm
https://blog.csdn.net/zhubinqiang/article/details/51096233
尊重他人劳动成果,转载请注明出处:Bluesky's blog » cpanm安装perl包/perl模块