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?

Lawrence I. Siden
  • 9,191
  • 10
  • 43
  • 56

1 Answers1

3

There is no Makefile target that will do what you want, but the cpan tool will use the information in the META file created by Makefile.PL to fetch and install dependencies.

If you to use cpan offline, consider cloning CPAN using CPAN::Mini.

ikegami
  • 367,544
  • 15
  • 269
  • 518