Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

About two times a year for the past two years, I revisit whether or not Makefile.pl or Build.pl is the standard way to "make" or "build" a perl module. In the past, I've read YAPC presentations detailing the fact that Makefile.pl is going away, read entries about how Build.pl was lacking the backwards compatibility of Makefile.pl, personally reviewed what usually shows up in the modules I'm downloading. At present, I am noticing more Build.pl scripts. Is it sample bias, or has the Perl community decided on a standard way to install (clearly this has nothing to do with Active State Installations, just Makefile.pl and Build.pl).
  • Comment on Makefile.pl and Build.pl, religions or standards

Replies are listed 'Best First'.
Re: Makefile.pl and Build.pl, religions or standards
by locked_user sundialsvc4 (Abbot) on Mar 05, 2009 at 21:43 UTC

    (Shrug...) “Who knows? The past will always be with us...”

    Makefile.PL started the ball rolling, and Builder sprang out of that and says that it's better. Whether or not it is, today we've got both. (And tomorrow, we'll also have “both.”) As an Implementor, evaluate both of them, and decide for yourself which one feels better to you today. Whatever you decide, it'll surely be a good decision for today. Over time, one-or-the-other will gradually fade out. (Maybe.) In the meantime, both of them will do the job. So, “no worries, mon.”

    It's really a waste-of-time to ponder how the future will judge your decisions.

Re: Makefile.pl and Build.pl, religions or standards
by chromatic (Archbishop) on Mar 05, 2009 at 22:12 UTC

    If you're doing something very simple (installing a pure-Perl module or set of modules without configuration), either one works fine. If you need to do something more complex, Module::Build may be easier to understand -- it's conceptually simpler, with fewer cross-platform moving parts.

    I use Module::Build exclusively because I think ExtUtils::MakeMaker is a big ball of horrible hacks, and I want it to go away forever. Not everyone agrees.

Re: Makefile.pl and Build.pl, religions or standards
by Tanktalus (Canon) on Mar 05, 2009 at 21:47 UTC

    Personally, I find the Build.PL method far simpler to parse in my head. So, that's the way I go. That said, I didn't find switching to be terribly onerous, so unless you have some really wacky stuff going on in your build, don't fret about it, you're not really locked in.

Re: Makefile.pl and Build.pl, religions or standards
by perrin (Chancellor) on Mar 05, 2009 at 22:56 UTC
    The newer tools, Module::Build and Module::Install, offer some useful things for developers. They automate the details of building dists, keeping MANIFEST up to date, etc. That's why I use Module::Build these days. But... I always have it generate a Makefile.PL too, since I don't care which one is used to install. The advantages are all on the dev side for me.
Re: Makefile.pl and Build.pl, religions or standards
by educated_foo (Vicar) on Mar 06, 2009 at 02:46 UTC
    If you want the largest number of people to be able to use your module with the least amount of pain, write a Makefile.PL. People who use a Build.PL either know both ways and have specific needs served by Build.PL, or have religious reasons for using Module::Build.
Re: Makefile.pl and Build.pl, religions or standards
by bellaire (Hermit) on Mar 06, 2009 at 01:45 UTC
    For me, if the module is a straightforward Perl module that just needs to be installed and have few dependencies, Makefile.PL is the way to go. As others have said, both are around and here to stay, but older versions of Perl are also still around, so compatability with older Perl and core modules is a consideration. There are probably also veterans who still haven't heard about Build.PL and might be confused if a module arrives without a Makefile.PL. Whether these are important considerations is up to you.

    For anything more complicated, I use Module::Build. It's a personal decision because I don't know a whole lot about Makefiles. If I want something complicated to happen, it's easier for me to work with Module::Build and make it happen using pure Perl and subclassing. That extensibility using Perl is what makes the decision for me.

    If you happen to know a lot about Makefiles, that may not even matter to you.
Re: Makefile.pl and Build.pl, religions or standards
by rgiskard (Hermit) on Mar 07, 2009 at 02:49 UTC
    If you're teaching a class about module creation, you're probably better-off taking some time to discuss one of the many build options as there is clearly no one correct option. If you're building a package, use what is easiest for you.