ExtUtils::MakeMaker::Tutorial

ExtUtils::MakeMaker::Tutorial is a tutorial about how to write a module with MakeMaker.
Download

ExtUtils::MakeMaker::Tutorial Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jarkko Hietaniemi
  • Publisher web site:
  • http://search.cpan.org/~jhi/

ExtUtils::MakeMaker::Tutorial Tags


ExtUtils::MakeMaker::Tutorial Description

ExtUtils::MakeMaker::Tutorial is a tutorial about how to write a module with MakeMaker. ExtUtils::MakeMaker::Tutorial is a tutorial about how to write a module with MakeMaker.SYNOPSIS use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Your::Module', VERSION_FROM => 'lib/Your/Module.pm' );This is a short tutorial on writing a simple module with MakeMaker. Its really not that hard.The MantraMakeMaker modules are installed using this simple mantra perl Makefile.PL make make test make installThere are lots more commands and options, but the above will do it.The LayoutThe basic files in a module look something like this. Makefile.PL MANIFEST lib/Your/Module.pmThat'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_programMakefile.PLWhen you run Makefile.PL, it makes a Makefile. That's the whole point of MakeMaker. The Makefile.PL is a simple module which loads ExtUtils::MakeMaker and runs the WriteMakefile() function with a few simple arguments.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.MANIFESTA simple listing of all the files in your distribution. Makefile.PL MANIFEST lib/Your/Module.pmFilepaths 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'.lib/This is the directory where your .pm and .pod files you wish to have installed go. They are layed out according to namespace. So Foo::Bar is lib/Foo/Bar.pm.t/Tests for your modules go here. Each test filename ends with a .t. So t/foo.t. 'make test' will run these tests. The directory is flat, you cannot, for example, have t/foo/bar.t run by 'make test'.Tests are run from the top level of your distribution. So inside a test you would refer to ./lib to enter the lib directory, for example. Requirements: · Perl


ExtUtils::MakeMaker::Tutorial Related Software