in reply to Trying to build a module for upload to CPAN
G'day Alex,
I use Module::Starter with Module::Starter::PBP as a plugin. I use that plugin mainly because I like the templates which I customise a lot (I also pull out the PBP specific parts, e.g. perlcritic.t).
I keep a number of config files for various purposes; e.g. OO mod, functional mod, $work mod, etc. Each of these points to a different directory with my customised templates. Here's the current one:
$ cat ~/.module-starter/config author: Ken Cotterill email: kcott@cpan.org builder: ExtUtils::MakeMaker plugins: Module::Starter::PBP template_dir: /home/ken/.module-starter/P532 $ ls -al ~/.module-starter/P532 total 24 drwxr-xr-x+ 1 ken None 0 Jan 9 2021 . drwxr-xr-x+ 1 ken None 0 Jan 6 2021 .. -rw-r--r-- 1 ken None 89 Jan 5 2021 Changes -rw-r--r-- 1 ken None 586 Jan 5 2021 Makefile.PL -rw-r--r-- 1 ken None 82 Jan 9 2021 MANIFEST.SKIP -rw-r--r-- 1 ken None 5205 Jan 5 2021 Module.pm -rw-r--r-- 1 ken None 313 Dec 19 2020 README drwxr-xr-x+ 1 ken None 0 Jan 9 2021 t
And, just to give you an idea of the templates, Module.pm has:
package <MODULE NAME>; ... =head1 LICENCE AND COPYRIGHT Copyright (c) <YEAR>, <AUTHOR> C<< <<EMAIL>> >>. All rights reserved. ...
Creating the module is a little easier with this plugin because you don't need to specify so many options (e.g. the --author="Andy Lester" --email=andy@petdance.com, or equivalent, are not required).
Creating the distribution uses the fairly standard incantation:
perl Makefile.PL make make test make dist
That last command creates the distribution tarball.
I'd generally want to also run Author Tests so something like this first (your environment variable may have a different name):
$ export RELEASE_TESTING=1
I've used this method dozens (if not hundreds) of times and not encountered problems: it seems robust and stable.
— Ken
|
|---|