cpanm安装及Perl模块安装教程(perfdump软件)难以置信

随心笔谈3年前发布 admin
209 0 0

文章摘要

Cpanm 是一个用于管理 CPAN 软件包的工具,支持从 CPAN、本地文件、镜像服务器等多种来源安装软件包。以下是其主要功能: 1. **安装选项**: - `--interactive`:强制交互配置(需用于模块配置)。 - `--force`:强制安装。 - `--test-only`:仅进行测试,不安装。 - `--installdeps`:仅安装依赖模块。 - `--showdeps`:仅显示依赖信息。 - `--reinstall`:重新安装。 2. **镜像选项**: - `--mirror`:指定镜像 URL(如 `http://cpan.cpantesters.org/`)。 - `--mirror-only`:仅从镜像下载。 3. **本地安装选项**: - `--local-lib`:指定安装目录。 - `--local-lib-contained`:安装非核心模块。 - `--self-contained`:安装所有非核心模块,即使它们已安装。 4. **环境控制**: - `--auto-cleanup`:设置工作目录自动清理天数(默认 7 天)。 5. **示例用法**: - 安装测试模块:`cpanm Test::More` - 通过 URL 安装:`cpanm http://example.org/LDS/CGI.pm-3.20.tar.gz` - 本地文件安装:`cpanm ~/dists/MyCompany-Enterprise-1.00.tar.gz` - 交互配置:`cpanm --interactive Task::Kensho` 总结: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

© 版权声明

相关文章