8. Module-Build and Module-Starter
Now let's tie everything together. When you download a Perl package from CPAN, there's a standard way to build and install it - perl Makefile.PL
, make
, make test
and make install
(or alternatively a similar process with perl Build.PL
and ./Build
).
When creating packages of Perl code, it is preferable to make them capable of being built this way, even if they are intended for internal use. That is because packaging them this way gives you many advantages, among them the ability to specify CPAN (and in-house) dependencies, integrity tests, configurability in building and installation, and simplification of the preparation of system packages (such as .rpm
s or .deb
s).
In this section we'll learn how to prepare your own CPAN-like package of Perl 5 code using module-starter and Module-Build. There are some variations on this theme, but it should get you started.
- 8.1. The Module-Starter Invocation Command
- 8.2. Module-Build commands
- 8.3. Adding meaningful code
- 8.4. Getting rid of the boilerplate
- 8.5. Additional Resources