What do I use to release a module to CPAN for the first time?
Several months ago I read a tutorial on module creation. It got me thinking about releasing some of my modules. I got to work getting my code organized. At the time I had all of my work in the directory for my site. So I moved my general purpose modules to their own directory and then started reading more about what is needed to get a module published on CPAN.
I first installed Module::Starter. It seemed like a good place to start, but then Dist::Zilla was suggested, so I installed it. Most recently Minilla suggested, and now it is installed. The problem is, I do not know which one to use. Do I use any of those at all, or is there yet another packaging module (with executable) out there?
Module::Starter (module-starter) appears to be for those starting with well thought out plans for what they want to write. I have been told Dist::Zilla (dzil) is not for a first time releaser. Minilla appears to be for those who have a complete package written and just need to get it compressed to send to CPAN.
I have also read Release::Checklist.
I know after the code, documentation, and tests are written; the rest should take maybe half an hour or less. I have lost all confidence I had several months ago when I thought it would be easy. I am drowning in an ocean of documentation that most might find to be only a wading pool. I am reaching out and grasping at whatever scrap I can find that might match my specific circumstances, but I keep getting bogged down. I am fairly sure releasing modules to CPAN should not cause tearful emotional breakdowns on a semi-regular basis, especially when it is just one module with less than 30 lines of code to it.
My circumstance is I have around 60 free floating .pm files I am thinking about publishing to CPAN. All have plain old documentation in various states of completion. All have at least their first tests written. (Only 2 have more than the use_ok
test in a BEGIN
block.)
The module I want to release first is Fancy::Open. It has a separate .pod file and one test file.
Where do I go from here? I am willing to do this all "by-hand" if need be since this is my very first package and release.
Apologies if this is not well written. I am so confused, but I do not want to give up like I have on other aspects of Perl.
I have sought wisdom on PerlMonks.
I've never used any of the clever distribution building tools like Dist::Zilla or Module::Starter. I like doing things manually.
There are really two things to get right - the directory structure and the Makefile.
The directory structure is simple. The library goes in to "lib", the tests are in "t", any programs go in "bin" and everything else is in the top-level directory.
As for Makefile, you do that using ExtUtils::MakeMaker and a Makefile.PL. Here's an example Makefile.PL from one of my modules. I've learned how to construct them by a combination of copying from other people's modules and reading the documentation for ExtUtils::MakeMaker.
Having created Makefile.PL, you create the Makefile by running "perl Makefile.PL". You can then run "make test" to run your tests, "make dist" to create the distribution file and "make disttest" to check that your distribution is structured correctly.
I then use cpan-upload to upload the module to CPAN.
Let me know if I can be any more help with this.