ExtUtils::ModuleMaker - Better than h2xs, for creating all the parts of modules
use ExtUtils::ModuleMaker; #die "You really don't want to use ModuleMaker again for this module." my $MOD = ExtUtils::ModuleMaker->new ( NAME => 'Sample::Module', ); $MOD->complete_build ();
This module is a replacement for h2xs. It can be called from a Modulefile.PL similar to calling MakeMaker from Makefile.PL.
See also: the 'modulemaker' program, which is included with this package, that simplifies the process for casual module builders; the vast majority of lazy Perl programmers.
perl Makefile.PL make make test make install
On windows machines use nmake rather than make. If you would like to test the scripts without a real installation you can replace Makefile.PL with Fakefile.PL to install in a temporaty place.
Send email to modulemaker@PlatypiVentures.com.
R. Geoffrey Avery CPAN ID: RGEOFFREY modulemaker@PlatypiVentures.com http://www.PlatypiVentures.com/perl/modules/ModuleMaker.shtml
Copyright (c) 2001-20022 R. Geoffrey Avery. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
modulemaker, perlnewmod, h2xs, ExtUtils::MakeMaker
Each public function/method is described here. These are how you should interact with this module.
Usage : Purpose : Creates an object for modules Returns : the module object Argument : A hash with the information for the new module(s) Throws : Comments :
See Also :
The only required feature. This is the name of the primary module (with '::' separators if needed). Will also support the older style separator "'" like the module D'Oh.
A short description of the module. CPAN likes to use this feature to describe the module.
A real number to be the version number. Do not use Linux style numbering with multiple dots like 2.4.24. For alpha releases include an underscore to the right of the dot like 0.31_21. (Default is 0.01)
Which license to include in the Copyright section. You can choose one of the standard licenses by including 'perl', 'gpl', 'artistic', and 18 others approved by opensource.org. The default is to choose the 'perl' flavor which is to share it "under the same terms as Perl itself".
Other licenses can be added by individual module authors to ExtUtils::ModuleMaker::Licenses::Local to keep your company lawyers happy.
Some licenses include placeholders that will be replaced with AUTHOR information.
This can take one of three values. These are 'ExtUtils::MakeMaker', 'Module::Build', and 'Module::Build and Proxy'. The first generates a basic Makefile.PL file for your module. The second creates a Build.PL file, and the last creates a Build.PL along with a proxy Makefile.PL script that attempts to install Module::Build if necessary, and then runs the Build.PL script. This option is recommended if you want to use Module::Build as your build system. See Module::Build::Compat for more details.
A hash containing information about the author to pass on to all the necessary places in the files.
Name of the author.
Email address of the author.
The CPANID of the author. If this is omited, then the line will not be added to the documentation.
The personal or organizational website of the author.
Company or group owning the module.
An array of hashes that each contain values for additional modules in the distribution. As with the primary module only NAME is required and primary module values will be used if no value is given here.
Each extra module will be created in the correct relative place in the lib directory, but no extra supporting documents, like README or Changes.
This is one major improvement over the earlier h2xs as you can now build multi-module packages.
For a module named "Foo::Bar::Baz" creates a base directory named "Foo-Bar-Baz" instead of Foo/Bar/Baz. (Default off)
Prints messages as it creates directories, writes files, etc. (Default off)
Suppresses 'die' when something goes wrong. Should only be used by interactive scripts like modulemaker. (Default off)
Used to create new directories. (Default is 0755, group and world can not write)
Message given when the module 'die's. Scripts should set this to the same string it would print if the user asked for help (often with a -h flag).
Include POD section in modules. (Default is on)
Include a simple 'new' method in the object oriented module. (Default is on)
Don't include a 'Changes' file and add a HISTORY section to the POD. (Default is off).
Usage : $self->default_values () Purpose : Defaults for 'new'. Returns : A hash of defaults as the basis for 'new'. Argument : n/a Throws : n/a Comments :
Usage : $self->verify_values () Purpose : Verify module values are valid and complete. Returns : Error message if there is a problem Argument : n/a Throws : Will die with a death_message if errors and not interactive. Comments :
Each private function/method is described here. These methods and functions are considered private and are intended for internal use by this module. They are not considered part of the public interface and are described here for documentation purposes.
If you choose to make a subclass of this module to customize ModuleMaker for your environment you may need to replace some or all of these functions to get what you need. But as a general rule programs should not be using them directly.
Usage : How to use this function/method Purpose : What it does Returns : What it returns Argument : What it wants to know Throws : Exceptions and other anomolies Comments : This is a sample subroutine header. : It is polite to include more pod and fewer comments.
Usage : Purpose : Create the directory where all the files will be created. Returns : $DIR = directory name where the files will live Argument : $package_name = name of module separated by '::' Throws : Comments :
See Also : Check_Dir
Usage : Check_Dir ($dir, $MODE); Purpose : Creates a directory with the correct mode if needed. Returns : n/a Argument : $dir = directory name $MODE = mode of directory (e.g. 0777, 0755) Throws : Comments :
Usage : $self->Block_Begin () Purpose : Build part of a module pm file Returns : Part of the file being built Argument : $module: pointer to the module being built, for the primary module it is a pointer to $self Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->Block_Begin_BareBones () Purpose : Build part of a module pm file Returns : Part of the file being built Argument : $module: pointer to the module being built, for the primary module it is a pointer to $self Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->Block_New_Method () Purpose : Build part of a module pm file Returns : Part of the file being built Argument : $module: pointer to the module being built, for the primary module it is a pointer to $self Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->Block_Module_Header () Purpose : Build part of a module pm file Returns : Part of the file being built Argument : $module: pointer to the module being built, for the primary module it is a pointer to $self Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->Block_Subroutine_Header () Purpose : Build part of a module pm file Returns : Part of the file being built Argument : $module: pointer to the module being built, for the primary module it is a pointer to $self Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->Block_Final_One () Purpose : Make module return a true value Returns : Part of the file being built Argument : $module: pointer to the module being built, for the primary module it is a pointer to $self Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->FileText_README () Purpose : Build a supporting file Returns : Text of the file being built Argument : n/a Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->FileText_Changes () Purpose : Build a supporting file Returns : Text of the file being built Argument : $only_in_pod: True value to get only a HISTORY section for POD False value to get whole Changes file Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->FileText_ToDo () Purpose : Build a supporting file Returns : Text of the file being built Argument : n/a Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->FileText_Makefile () Purpose : Build a supporting file Returns : Text of the file being built Argument : n/a Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->FileText_Buildfile () Purpose : Build a supporting file Returns : Text of the file being built Argument : n/a Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->FileText_Proxy_Makefile () Purpose : Build a supporting file Returns : Text of the file being built Argument : n/a Throws : n/a Comments : This method is a likely candidate for alteration in a subclass
Usage : $self->FileText_Test () Purpose : Build a supporting file Returns : Text of the file being built Argument : n/a Throws : n/a Comments : This method is a likely candidate for alteration in a subclass Will make a test with or without a checking for method new.
Usage : perl -MExtUtils::ModuleMaker -e "Quick_Module ('Sample::Module')" or use ExtUtils::ModuleMaker; Quick_Module ('Sample::Module'); Purpose : Creates a Module.pm with supporing files Returns : n/a Argument : A name for the module, like 'Module' or 'Sample::Module' Throws : Comments : More closely mimics h2xs behavior than Generate_Module_Files. : Included to allow simple creation from a command line. : This function is deprecated and will disappear forever soon.
See Also : Generate_Module_Files
Usage : How to use this function/method Purpose : Creates one or more modules with supporing files Returns : n/a Argument : A hash with the information for the new module(s) Throws : Comments : This function is deprecated and will disappear forever soon.
To install ExtUtils::ModuleMaker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ExtUtils::ModuleMaker
CPAN shell
perl -MCPAN -e shell install ExtUtils::ModuleMaker
For more information on module installation, please visit the detailed CPAN module installation guide.