cpanm是安装Perl模块的最方便的方法。自动下载安装依赖包。使用CPAN shell或下载源码包安装模块,遇到大量依赖关系,非常头痛。下面就是一例:
安装MongoDB模块
1. 安装cpanm
cpanm其实是一个可执行文件而已。将它下载到bin目录,然后添加执行权限就可以了。
2. 使用cpanm安装模块
  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
参数名直接为模块名称
如,安装MongoDB模块
为了加快下载速度, 可以指定使用镜像,并只从镜像下载:
3. 删除模块
安装App::pmuninstall模块:
4.删除模块
MongoDB.so: undefined symbol: HeUTF8 问题解决方案参见:https://www.VeVB.COm/article/56285.htm
新闻热点
疑难解答