CPAN模块先决条件 [英] CPAN module prereqs

查看:66
本文介绍了CPAN模块先决条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划不久将模块上传到CPAN。这是我贡献的第一个模块。我已经将模块设置为测试阶段。我正在使用ExtUtils :: MakeMaker通过Makefile.PL生成一个Makefile(我在下面粘贴了它的内容)。 Makefile.PL脚本列出了所有的prereq模块。我想知道在安装过程中的哪个阶段安装prereq模块(如果不存在)?我想知道是因为我先运行Makefile.PL,然后运行 make 然后运行 make install 在一个缺少某些内容的单独环境中prereq模块。但是,他们没有安装?我印象中他们会,但也许我错过了什么?我正在寻找可以澄清的人。预先感谢〜

I plan on uploading a module to CPAN, shortly. This is the first module I've contributed. I've got the module to what I'd consider a "beta" stage. I'm using ExtUtils::MakeMaker to generate a Makefile through Makefile.PL (I've pasted the contents of it below). The Makefile.PL script has all the prereq modules listed. I'm wondering at which point in the installation process, the prereq modules are installed if they're not present? I'm wondering because I ran Makefile.PL followed by make then make install in a separate environment that's missing some of the prereq modules. However, they were not installed? I was under the impression they would be but maybe im missing something? I'm looking for someone to provide some clarity. Thanks in advance~

Makefile.PL

Makefile.PL

#!/usr/bin/env perl 

use strict;
use warnings;
use ExtUtils::MakeMaker;

WriteMakefile(
    NAME      => 'Imgur',
    VERSION   => '0.01',
    PREREQ_PM => {
        'JSON'                      => 2.90,
        'LWP::UserAgent'            => 6.05,
        'HTTP::Request::Common'     => 6.04,
        'Data::Dumper'              => 2.154,
        'DateTime::Format::ISO8601' => 0.08,
        'Config::IniFiles'          => 2.86,
        'Scalar::Util'              => 1.42,
        'Class::Std::Utils'         => 0.0.3,
        'MIME::Base64'              => 3.15,
        'File::Slurp'               => 9999.19
    }
);


推荐答案

Makefile.PL未安装必备软件;它只是抱怨是否未安装。安装必备软件是CPAN客户端的工作。

The Makefile.PL doesn't install prerequisites; it just complains if they're not installed. It's the CPAN client's job to install prerequisites.

注意:Module::Install 具有实现此功能的 auto_install 功能,但是普遍的共识似乎是使用它不是一个好主意。

Note: Module::Install has an auto_install feature that does this, but the general consensus seems to be that using it is a bad idea.

这篇关于CPAN模块先决条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆