1

I'm building a Perl module. Makefile.PL has

WriteMakefile(
    PREREQ_PM         => {
      'DBI' => '>= 1.641, < 2',
      # etc, ...
    },
    TEST_REQUIRES => {
      'Test::More' => 0,
    },
    # more stuff ...
);

Recently, my ~/perl5 tree got corrupted (PERL5LIB=~/perl5) so I decided to rebuild it, so I blew it away. Doesn't WriteMakefile() generate some make target that will do this for me with all the modules/packages in PREREQ_PM and TEST_REQUIRES. Instead, it just prints warnings:

Warning: prerequisite DBI >= 1.641, < 2 not found.

So I have to start re-installing all these by hand in order to run tests. For my small project, this isn't such a problem, but what if the project had many dependencies? Isn't there a way to automate this?

4

1 回答 1

3

没有Makefile目标可以满足您的需求,但该cpan工具将使用META创建的文件中的信息Makefile.PL来获取和安装依赖项。

如果要cpan离线使用,请考虑使用CPAN::Mini克隆 CPAN 。

于 2018-07-23T19:31:27.737 回答