makeperlmod - Perl program for creating new modules with ExtUtils::ModuleMaker::TT
makeperlmod [ -c config_file ] mode_option [argument] [-e extra_info ]
This program is a front-end to ExtUtils::ModuleMaker::TT. It supports:
One of the following mode options is required and only one may be used.
Writes out default options from ExtUtils::ModuleMaker to the given file in "Apache" config format. Use to create a new base for a custom config file. CONFIG is either a short configuration name or an absolute path to a file. A default value is used if CONFIG is not given. See "CONFIGURATION FILES" below for details. This option prints the location of the config file on completion.
Prints the location of the named config file, or the default if CONFIG is not given. Helpful for finding the right config file to edit. See "CONFIGURATION FILES" below for details.
Creates DIRECTORY if it doesn't exist and write all default templates as separate files in that directory for subsequent user customization (Add a TEMPLATE_DIR option with DIRECTORY to your custom config file to use this as a custom template directory)
Creates a skeleton distribution for MODULE::NAME. Directory name will be determined by the COMPACT option set in the config file
Creates a new .pm and corresponding .t file in an existing distribution. Must be called from within an existing distribution tree, though not necessarily at the top level. I.e., can be called from lib/Sample/Module and will still place files correctly
Prints to STDOUT a skeleton for a single method. Most useful when called from within an editor to insert code. See EXAMPLES.
Prints version information and current configuration settings (either default or from a -c option)
Prints usage information
Specifies an alternate configuration file to use in place of the default one
Defines an additional module (for -n and -m modes) or method (for -s mode) to be created. May be used more than once to define multiple extras
makeperlmod has a multi-level configuration system. Options that control creation of a skeleton distribution are processed as follows, with each subsequent source extending or overriding the previous one:
This preserves maximum flexibility and compatibility with the personal defaults system in ExtUtils::ModuleMaker. makeperlmod allows one or more additional configuration files to customize those defaults for special purposes.
Generally, static information like AUTHOR should probably go in the ExtUtils::ModuleMaker::Personal::Defaults file. TEMPLATE_DIR could go in the makeperlmod config files to allow for different templates to be used for different projects.
The directory for config files is located in an operating system-specific fashion using Config::Find. For example, this is typically
~/.makeperlmod/ on Unix-based systems or something in a
makeperlmod directory located somewhere under
C:\Documents and Settings\Username\ on MSWin32.
If no config file is specified, the default is 'default.conf'. Short config names are found in the operating system specific directory with a '.conf' extension. If an absolute file pathname is given, that is used directly. 'makeperlmod -l CONFIG' will always show how a given CONFIG option is interpreted by makeperlmod. For example, on Linux:
$ makeperlmod -l /home/david/.makeperlmod/default.conf $ makeperlmod -l default /home/david/.makeperlmod/default.conf $ makeperlmod -l freelance /home/david/.makeperlmod/freelance.conf $ makeperlmod -l /etc/makeperlmod/corp/std.conf /etc/makeperlmod/corp/std.conf
Create a custom configuration file
Create a custom template directory
makeperlmod -t ~/.makeperlmod.templates
Edit the custom configuration file. Set AUTHOR and other defaults as desired. Set TEMPLATE_DIR to the templates directory (e.g. ~/.makeperlmod.templates ) to use your own custom templates in place of the defaults.
Create a new distribution
makeperlmod -n Sample::Module::Foo
Create a new distribution with an extra module
makeperlmod -n Sample::Module::Foo -e Sample::Module::Bar
From within the new distribution, add another .pm
cd Sample-Module-Foo/lib/Sample/Module makeperlmod -m Sample::Module::Baz
From within an editor, insert a new subroutine skeleton. E.g. from within vi,
:r! makeperlmod -s sample_method
Or insert several subroutines
:r! makeperlmod -s sample_method -e method2 -e method3
Please report bugs using the CPAN Request Tracker at http://rt.cpan.org/NoAuth/Bugs.html?Dist=ExtUtils-ModuleMaker-TT
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
David A Golden (DAGOLDEN)
Copyright (c) 2004-2005 by David A Golden
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.