frazap has asked for the wisdom of the Perl Monks concerning the following question:

I'm writing a module that has the following PREREQ_PM
PREREQ_PM => { 'Test::More' => 1, 'interface' => 0.03, 'Try::Tiny' => 0.22, 'DBI' => 1.631, 'Carp' => 1.17, 'Log::Log4perl' => 1.41, 'Data::Dumper' => 2.154, 'SQL::Abstract::More' => 1.27 },
I'm would like to test that the intall process fetch and setup the missing module(s), so on my .../perl/site/lib directory I have renamed interface.pm to _interface.pm.

I have also added in the test (using Test::More)

require_ok('interface'); Now when I run dmake disttest that test failed.

I thought that running

perl Makefile.pl dmake
would download and install the Scott Walter's interface module...

but no...

What am I missing ?

Thanks

F.

Replies are listed 'Best First'.
Re: Module creation: testing prerequisite
by Corion (Patriarch) on Aug 19, 2016 at 09:46 UTC

    If you want to install the prerequisites of a module distribution unpacked in the current directory, just run

    cpanm --installdeps .

    This will run your Makefile.PL, extract the prerequisites, and then install the missing prerequisites.

    I think that cpan itself can also install just the prerequisites of a module, but I don't know the incantation off-hand.

Re: Module creation: testing prerequisite
by Anonymous Monk on Aug 19, 2016 at 09:44 UTC

    What am I missing ?

    realistic expectations

    You've confused a feature of cpan/cpanm/cpanp , installing missing/required prerequisites, with a feature of ExtUtils::MakeMaker/Makefile.PL

    See Module::AutoInstall and ExtUtils::AutoInstall