Yes. Use a standard build management module like
ExtUtils::MakeMaker
or Module::Build
, which have conventions to handle prerequisites.
For ExtUtils::MakeMaker
, the convention is to pass prerequisite information in the PREREQ_PM
argument to the WriteMakefile
function. Here's what it might look like:
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'My::Module',
AUTHOR => 'Me',
VERSION_FROM => 'lib/My/Module.pm',
PREREQ_PM => {
'Some::Module' => 0.42, # need >=v0.42 of Some::Module
'Some::Other::Module' => 0, # but any version of Some::Other::Module is ok
}
dist => ... ,
clean => ... ,
...
);