The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

makeperlmod - Perl program for creating new modules with ExtUtils::ModuleMaker::TT

SYNOPSIS

 makeperlmod [ -c config_file ] mode_option [argument] [-e extra_info ]

DESCRIPTION

This program is a front-end to ExtUtils::ModuleMaker::TT. It supports:

  • reading/writing a configuration file

  • generating a directory of default templates

  • building new distribution directories

  • creating new .pm and .t files within an existing distribution directory

  • printing a skeleton method to STDOUT

Configuration options are read from ~/.makeperlmodule.conf or other standard configuration file locations. Automatic config finding subroutine taken and modified from Config::Auto -- see that module for alternative config file locations.

OPTIONS

Mode Options

One of the following mode options is required and only one may be used.

-d or --defaults

Prints out default options from ExtUtils::ModuleMaker in "Apache" config format. Redirect to a file to create a custom config file.

-t DIRECTORY or --templates DIRECTORY

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)

-n MODULE::NAME or --newdist MODULE::NAME

Creates a skeleton distribution for MODULE::NAME. Directory name will be determined by the COMPACT option set in the config file

-m MODULE::NAME or --module MODULE::NAME

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

-s METHOD_NAME or --subroutine METHOD_NAME

Prints to STDOUT a skeleton for a single method. Most useful when called from within an editor to insert code. See EXAMPLES.

-V or --version

Prints version information and current configuration settings (either default or from a -c option)

-h or -? or --help

Prints usage information

Additional Options

-c or --config

Alternate configuration file to use in place of the default one

-e EXTRA or --extra EXTRA

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

EXAMPLES

Create a custom configuration file

        makeperlmod -d > ~/.makeperlmod.config

Create a custom template directory

        makeperlmod -t ~/.makeperlmod.templates
 

Edit the custom configuration file. Set AUTHOR and other defaults as desired. (Setting COMPACT to 1 is recommended.) Set TEMPLATE_DIR to a 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
 

BUGS AND SUPPORT

See ExtUtils::ModuleMaker::TT for more details.

AUTHOR

 David A. Golden (DAGOLDEN)
 david@dagolden.com
 http://dagolden.com/
 

COPYRIGHT AND LICENSE

Copyright (c) 2004 by David A. Golden

This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.