CPAN module prereqs

204 views Asked by At

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

#!/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
    }
);
1

There are 1 answers

3
cjm On BEST ANSWER

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.

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.