Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Trying to build a module for upload to CPAN

by kcott (Archbishop)
on Oct 29, 2021 at 06:54 UTC ( [id://11138170]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11138170]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (1)
As of 2024-04-19 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found