How to manage the installation of modules used by an open source Perl project?

I am working on a small Perl project with a directory, Open Street Map and dozens of modules. I try to use as many modules on CPAN as possible because my goal is not to reinvent the wheel.

All these things were installed through cpanm and local :: lib. Every time I need something new, I install a couple of modules and dependencies (it's that simple with cpanm). Now I ask myself, how can the people who will clone my project install dozens of modules without the terrible death headache?

What are the best methods for doing this? Should I list all the necessary modules in Makefile.pl? I am now worried about this because I worked hard on this project, I try to follow many good practices, but I feel that I will make a mistake in this particular matter (do not think about it).

I need advice on this problem because everything seems so magical that I do not believe that it is enough to list the module names in the Makefile with the keyword β€œrequire”. I hope that it is also not necessary to include all the dependencies in the project and transfer this whole huge package for future use.

+7
source share
3 answers

You should only list (in Makefile.PL ) those modules that you need directly (i.e. those that you use or require in your modules). You do not need to worry about modules that are needed indirectly (i.e. the modules you are using); This is the task of the installer.

To get a list of the modules that you use, you can, of course, compile the list manually. But if you have The Definitive Guide to Catalyst, page 129 has a handy Bash feature that I'm not sure I can reproduce here. There is also Perl :: PrereqScanner :: App , which I did not use directly, but which is used by Dist :: Zilla.

FWIW, if you use Dist :: Zilla to manage your distribution (which I do even for private projects that I don’t upload to CPAN), it can (and does by default) track dependencies for you.

+1
source

If you are using Catalyst, you can add the modules you need depending on the Makefile.PL created for your Catalyst application.

+4
source

I would recommend looking into carton (from the same author as the amazing cpanm).

I'm a big fan of the Ruby bundler , and the documentation in the box describes it as "Bundler for Perl." I experimented with him a while ago, and it looked very promising.

+1
source

All Articles