http://www.perlmonks.org?node_id=1015716

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

So my question is pretty simple.

I noticed most modules use ExtUtils::MakeMaker and their Makefile.PL looks like this:

use ExtUtils::MakeMaker; WriteMakefile( ATTRIBUTE => VALUE [, ...] );

But some distributions, like Net::GitHub look very different:Link to the Makefile.pl.

This seems to use inc::Module::Install.

Replies are listed 'Best First'.
Re: what format should Makefile.pl be and where is the list of attributes
by davido (Cardinal) on Jan 28, 2013 at 20:10 UTC

      Excellent this is the filter/pointer I was looking for.

      Generally I've been scrounging many books on my kindle and just getting hands on dirty. But I was considering buy a physical copy of intermediate perl and studying it back and forth.

Re: what format should Makefile.pl be and where is the list of attributes
by tobyink (Canon) on Jan 28, 2013 at 17:27 UTC

    Virtually all Makefile.PLs use ExtUtils::MakeMaker, except for some which are slim redirects to Build.PL in Module::Build-based distributions (which don't use makefiles).

    Module::Install is just a wrapper around ExtUtils::MakeMaker. It happens to be rather a good wrapper that enables you do some useful packaging stuff automatically, like automatically create your README file from your main module's pod, automatically make you a coffee at the end of the build process, etc.

    (And there's also Module::Package, which is a wrapper around Module::Install.)

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
Re: what format should Makefile.pl be and where is the list of attributes
by Anonymous Monk on Jan 28, 2013 at 15:41 UTC
Re: what format should Makefile.pl be and where is the list of attributes
by DrHyde (Prior) on Jan 29, 2013 at 11:11 UTC

    Using ExtUtils::MakeMaker is preferred.

    The 'repository' stuff ends up in META.yml, which is what search.cpan and metacpan (and a load of other sites like cpandeps) use, and you can also do it with EU::MM. Look for 'META_MERGE' in the doco. However, META.yml has historically been a bit of a moving target and some fields - including 'repository' - have moved around, so consult the documentation to make sure you put them in the right place.

    The current spec for META.yml is at CPAN::Meta::Spec.