CPAN要求文件 [英] CPAN Requirements File
问题描述
使用pip,您可以创建需求文件以指定要安装的库.使用CPAN的perl模块是否等效?
With pip you are able to create a requirements file to specify which libraries to install. Is there an equivalent for perl modules using CPAN?
我遇到过ExtUtils :: MakeMaker,但这似乎是make文件专门针对每个模块的.
I came across ExtUtils::MakeMaker, but this seems like the make file is for each module specifically.
我想尝试更好地了解我要问的是是否有一种方法可以做类似的事情
I guess to try and give a better idea of what I am asking is if there is a way to do something like
cpan install -r requirements.txt
,然后在该需求文件中指定要安装的模块.
and then specify which modules to install in that requirements file.
提前谢谢!
推荐答案
我认为您正在寻找Carton.
I think Carton is what you're looking for.
要开始使用纸箱,请先安装它.然后使用您的依赖项创建一个cpanfile:
To start using Carton, install it. Then create a cpanfile with your dependencies:
require 'Test::Most';
require 'Math::BaseConvert';
在放置此文件后,运行
carton install
这将在必要时安装这些模块,并编写一个名为cpanfile.snapshot的文件,其中包含相关性信息.
This will install those modules, if necessary, and write a file called cpanfile.snapshot with dependency information.
PS:检查Stratopan.
PS: Check out Stratopan.
这篇关于CPAN要求文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!