简体   繁体   中英

How to install multiple perl modules at once using CPAN

Is it possible to install multiple modules using CPAN? I've tried:

perl -MCPAN -e 'install DBIx::Transaction File::Basename::Object'

but I get this error:

Can't locate object method "Transaction" via package "DBIx" at -e line 1

You need a separate install command for each module:

perl -MCPAN -e 'install DBIx::Transaction; install File::Basename::Object'

If you want to simplify the install process even more, take a look at cpanm , which requires no configuration and by default will install modules without prompting.

You can install both modules with a single cpanm command like this:

cpanm DBIx::Transaction File::Basename::Object

Although as ikegami points out, this is not exactly the same as the first command since you can't specify which version of perl to use.

cpan DBIx::Transaction File::Basename::Object

或者如果您正在尝试确保使用特定的perl

perl -MCPAN -e'install($_) for qw( DBIx::Transaction File::Basename::Object )'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM