{
    "mode": "info",
    "parameter": "ExtUtils::MakeMaker::Tutorial",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/ExtUtils%3A%3AMakeMaker%3A%3ATutorial/json",
    "generated": "2026-07-05T06:48:50Z",
    "synopsis": "use ExtUtils::MakeMaker;\nWriteMakefile(\nNAME            => 'Your::Module',\nVERSIONFROM    => 'lib/Your/Module.pm'\n);",
    "sections": {
        "ExtUtils::MakeMaker::TuPerlaProgrammers ReExtUtils::MakeMaker::Tutorial(3perl)": {
            "content": "",
            "subsections": []
        },
        "NAME": {
            "content": "ExtUtils::MakeMaker::Tutorial - Writing a module with MakeMaker\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use ExtUtils::MakeMaker;\n\nWriteMakefile(\nNAME            => 'Your::Module',\nVERSIONFROM    => 'lib/Your/Module.pm'\n);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is a short tutorial on writing a simple module with MakeMaker.\nIt's really not that hard.\n\nThe Mantra\nMakeMaker modules are installed using this simple mantra\n\nperl Makefile.PL\nmake\nmake test\nmake install\n\nThere are lots more commands and options, but the above will do it.\n\nThe Layout\nThe basic files in a module look something like this.\n\nMakefile.PL\nMANIFEST\nlib/Your/Module.pm\n\nThat's all that's strictly necessary.  There's additional files you\nmight want:\n\nlib/Your/Other/Module.pm\nt/sometest.t\nt/someothertest.t\nChanges\nREADME\nINSTALL\nMANIFEST.SKIP\nbin/someprogram\n\nMakefile.PL\nWhen you run Makefile.PL, it makes a Makefile.  That's the whole\npoint of MakeMaker.  The Makefile.PL is a simple program which\nloads ExtUtils::MakeMaker and runs the WriteMakefile() function to\ngenerate a Makefile.\n\nHere's an example of what you need for a simple module:\n\nuse ExtUtils::MakeMaker;\n\nWriteMakefile(\nNAME            => 'Your::Module',\nVERSIONFROM    => 'lib/Your/Module.pm'\n);\n\nNAME is the top-level namespace of your module.  VERSIONFROM is\nthe file which contains the $VERSION variable for the entire\ndistribution.  Typically this is the same as your top-level module.\n\nMANIFEST\nA simple listing of all the files in your distribution.\n\nMakefile.PL\nMANIFEST\nlib/Your/Module.pm\n\nFile paths in a MANIFEST always use Unix conventions (ie. /) even\nif you're not on Unix.\n\nYou can write this by hand or generate it with 'make manifest'.\n\nSee ExtUtils::Manifest for more details.\n\nlib/\nThis is the directory where the .pm and .pod files you wish to have\ninstalled go.  They are laid out according to namespace.  So\nFoo::Bar is lib/Foo/Bar.pm.\n\nt/  Tests for your modules go here.  Each test filename ends with a .t.\nSo t/foo.t  'make test' will run these tests.\n\nTypically, the t/ test directory is flat, with all test files\nlocated directly within it. However, you can nest tests within\nsubdirectories, for example:\n\nt/foo/subdirtest.t\n\nTo do this, you need to inform \"WriteMakeFile()\" in your\nMakefile.PL file in the following fashion:\n\ntest => {TESTS => 't/*.t t/*/*.t'}\n\nThat will run all tests in t/, as well as all tests in all\nsubdirectories that reside under t/. You can nest as deeply as\nmakes sense for your project.  Simply add another entry in the test\nlocation string. For example, to test:\n\nt/foo/bar/subdirtest.t\n\nYou would use the following \"test\" directive:\n\ntest => {TESTS => 't/*.t t/*/*/*.t'}\n\nNote that in the above example, tests in the first subdirectory\nwill not be run. To run all tests in the intermediary subdirectory\npreceding the one the test files are in, you need to explicitly\nnote it:\n\ntest => {TESTS => 't/*.t t/*/*.t t/*/*/*.t'}\n\nYou don't need to specify wildcards if you only want to test within\nspecific subdirectories. The following example will only run tests\nin t/foo:\n\ntest => {TESTS => 't/foo/*.t'}\n\nTests are run from the top level of your distribution.  So inside a\ntest you would refer to ./lib to enter the lib directory, for\nexample.\n\nChanges\nA log of changes you've made to this module.  The layout is free-\nform.  Here's an example:\n\n1.01 Fri Apr 11 00:21:25 PDT 2003\n- thing() does some stuff now\n- fixed the wiggy bug in withit()\n\n1.00 Mon Apr  7 00:57:15 PDT 2003\n- \"Rain of Frogs\" now supported\n\nREADME\nA short description of your module, what it does, why someone would\nuse it and its limitations.  CPAN automatically pulls your README\nfile out of the archive and makes it available to CPAN users, it is\nthe first thing they will read to decide if your module is right\nfor them.\n\nINSTALL\nInstructions on how to install your module along with any\ndependencies.  Suggested information to include here:\n\nany extra modules required for use\nthe minimum version of Perl required\nif only works on certain operating systems\n\nMANIFEST.SKIP\nA file full of regular expressions to exclude when using 'make\nmanifest' to generate the MANIFEST.  These regular expressions are\nchecked against each file path found in the distribution (so you're\nmatching against \"t/foo.t\" not \"foo.t\").\n\nHere's a sample:\n\n~$          # ignore emacs and vim backup files\n.bak$       # ignore manual backups\n\\#          # ignore CVS old revision files and emacs temp files\n\nSince # can be used for comments, # must be escaped.\n\nMakeMaker comes with a default MANIFEST.SKIP to avoid things like\nversion control directories and backup files.  Specifying your own\nwill override this default.\n\nbin/\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "perlmodstyle gives stylistic help writing a module.\n\nperlnewmod gives more information about how to write a module.\n\nThere are modules to help you through the process of writing a module:\nExtUtils::ModuleMaker, Module::Starter, Minilla::Tutorial,\nDist::Milla::Tutorial, Dist::Zilla::Starter\n\nperl v5.34.0                      2026-06-ExtUtils::MakeMaker::Tutorial(3perl)",
            "subsections": []
        }
    },
    "summary": "ExtUtils::MakeMaker::Tutorial - Writing a module with MakeMaker",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "Tutorial",
            "section": "3perl",
            "url": "https://www.chedong.com/phpMan.php/man/Tutorial/3perl/json"
        }
    ]
}