作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 Python 中我们有 pip install -r requirements.txt
。 perl 中有类似的东西吗?
我怎样才能从这个 ExtUtils::Installed 列表开始并首先安装给定的 perl,然后安装正确的版本模块?
./installed.pl
DBD::SQLite - 1.66
DBI - 1.643
Perl - 5.26.1
Extutils 适用于目录路径和 .packlists
最佳答案
你的容器应该首先安装正确的 perl(比如 perlbrew ),然后是 App::cpanminus .之后,一个名为 cpanfile 的文件对应于上面的 requirements.txt 或 .packlist,看起来像
requires 'DBI' => '1.643';
requires 'DBD::SQLite' => '1.66';
您使用 cpanm --installdeps 进行安装。
将安装其余部分。
该文件格式指定了这些模块的最低版本,即隐式 >=
。如果您需要固定特定版本,请使用 ==
或避免使用带有 !=
的版本。
cpanfile 格式很灵活,允许您使用 --with-develop
标志等有条件地安装模块
编辑:有些人更喜欢 cpm 的速度通过 cpanm 安装大量模块。它采用一些快捷方式(默认情况下跳过测试),这些快捷方式在稳定的环境中不会产生影响。
关于perl 依赖管理 extUtils::Installed list into a container,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68272447/
我是一名优秀的程序员,十分优秀!