CPAN Requirements File

送分小仙女□ 提交于 2019-12-05 02:16:38

I think Carton is what you're looking for.

To start using Carton, install it. Then create a cpanfile with your dependencies:

require 'Test::Most';
require 'Math::BaseConvert';

With this file in place, run

carton install

This will install those modules, if necessary, and write a file called cpanfile.snapshot with dependency information.

Also see: Brief Notes on Managing Perl Dependencies with Carton

PS: Check out Stratopan.

When you install modules from CPAN, each module specifies its dependencies in the Makefile.PL (or Build.PL) and the CPAN shell will resolve those dependencies recursively when installing.

If you want to specify dependencies for an application (rather than a CPAN module), you can create a file called cpanfile in this format:

requires 'JSON';
requires 'Template';
requires 'DateTime';
requires 'DBIx::Class';

Then you can install those dependencies with one command:

cpanm --installdeps .

The cpanm command comes from the App::cpanminus distribution and is an alternative tool for installing modules from CPAN.

See the cpanfile docs for more information.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!