Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use Module::Install or Module::Build?

Tags:

module

perl

I'm writing a programmer's text editor (yes another one) in Perl called Kephra, which is also a CPAN module of course and bundled with Module::Install. Recently I saw that Module::Build has gone into core, so if I switch I could reduce dependencies. Is there any other reason to switch?

like image 782
sir_lichtkind Avatar asked Dec 15 '08 18:12

sir_lichtkind


1 Answers

We use Module::Build in our group.

The main reason is Easy Extensibility.

Module::Build allows you to do more with your build process in pure Perl through subclassing. If you want to do more using Module::Install, you have to have knowledge of how Makefiles work, AFAIK. Since you presumably already know Perl, this can be an advantage.

As you said, using Module::Build removes the dependency on an external make program, which can be viewed as a good thing.

However, the main cons that I can think of are:

  • Although Module::Build has hit core, not everyone will be using an up-to-date version of Perl. For users with older versions of the core, you will be creating a new dependency.
  • Lots of veterans (not necessarily Perl people) are used to the perl Makemaker.PL; make; make install paradigm, and can be thrown off by having Build.PL instead. Hopefully this isn't a big deal.
  • Module::Build has occasionally broken our builds when its functionality has changed because the documentation didn't cover an edge case which we were using. The edge case was then changed and documented, but we had to re-code our subclass to get our build to work again (this happened for us at the recent upgrade from 0.2808 to 0.3).

All that said, though, I still recommend Module::Build simply for the extensibility. If that's not an issue for you, you may be better off sticking with Module::Install.

like image 141
Adam Bellaire Avatar answered Oct 25 '22 21:10

Adam Bellaire