package ExtUtils::MakeMaker::Tutorial;
our $VERSION = 0.02;
=head1 NAME
ExtUtils::MakeMaker::Tutorial - Writing a module with MakeMaker
=head1 SYNOPSIS
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Your::Module',
VERSION_FROM => 'lib/Your/Module.pm'
);
=head1 DESCRIPTION
This is a short tutorial on writing a simple module with MakeMaker.
Its really not that hard.
=head2 The Mantra
MakeMaker modules are installed using this simple mantra
perl Makefile.PL
make
make test
make install
There are lots more commands and options, but the above will do it.
=head2 The Layout
The basic files in a module look something like this.
Makefile.PL
MANIFEST
lib/Your/Module.pm
That's all that's strictly necessary. There's additional files you might
want:
lib/Your/Other/Module.pm
t/some_test.t
t/some_other_test.t
Changes
README
INSTALL
MANIFEST.SKIP
bin/some_program
=over 4
=item Makefile.PL
When you run Makefile.PL, it makes a Makefile. That's the whole point of
MakeMaker. The Makefile.PL is a simple program which loads
ExtUtils::MakeMaker and runs the WriteMakefile() function to generate a
Makefile.
Here's an example of what you need for a simple module:
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Your::Module',
VERSION_FROM => 'lib/Your/Module.pm'
);
NAME is the top-level namespace of your module. VERSION_FROM is the file
which contains the $VERSION variable for the entire distribution. Typically
this is the same as your top-level module.
=item MANIFEST
A simple listing of all the files in your distribution.
Makefile.PL
MANIFEST
lib/Your/Module.pm
File paths in a MANIFEST always use Unix conventions (ie. /) even if you're
not on Unix.
You can write this by hand or generate it with 'make manifest'.
See L