Looking for some insight on how to add multiple PM files to the MakeMaker script?
I see this documentation and all the examples look like one file is added, how do I add multiple files?
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Your::Module',
VERSION_FROM => 'lib/Your/Module.pm'
);
Do I just add another set of values?
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Your::Module',
VERSION_FROM => 'lib/Your/Module.pm'
NAME => 'Your::Module2',
VERSION_FROM => 'lib/Your/Module2.pm'
);
The answer is: do nothing. Your original code and layout is fine. MakeMaker will find your modules in lib without you lifting a finger. Try it and see.
Explicitly writing out PM as in toolic's answer is unnecessary and brittle.
toolic's answer already points you to the docs, but I'll answer the other part of the question (although it is also in the docs):
NAME is the string Makemaker uses for the distribution name. Although this is often the main module, it can really be anything you like.
VERSION_FROM tells Makemaker that it should take the $VERSION from a specific file and use that at the distribution version. Most often, people use the version of the main module as the distribution version, but you don't have to do that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With