GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Module::Install::Template(3) User Contributed Perl Documentation Module::Install::Template(3)

Module::Install::Template - Treat module source code as a template

    # in C<Makefile.PL>:

    process_templates(
        first_year => 2007,
        rest_from  => "$ENV{HOME}/.mitlib/standard_pod",
        start_tag  => '{%',
        end_tag    => '%}',
    );

This module, if used in the "Makefile.PL" as shown in the synopsis, treats module source code files as templates and processes them with the Template Toolkit during "make" time.

That is, "lib/" is expected to contain templates, and "blib/lib/" will contain the resulting files as processed by the Template Toolkit.

This only happens on the author's side. The end-user will not notice any of it.

This module provides one subroutine: "process_templates()". It takes named arguments. Of these, "start_tag" and "end_tag" are treated specially and used for the template's start and end tag definitions. "rest_from" instructs this module to look for distribution attributes ("version", "perl_version", "author", "license", "abstract") that haven't been set yet in the given file.

For example, you might have some standard POD template that you use in all your modules - standard stuff like installation, availability, author, copyright notices and so on. You could have that in the special directory "~/.mitlib" ("mit" here stands for 'Module::Install::Template'). Because of that, the Module::Install directive "all_from" won't work properly. With "rest_from" you can instruct this module to take the remaining distribution attributes from your standard template.

The Makefile had to be slightly patched so that "make dist" still works - normally "make dist" takes files from "lib/", but here these are the templates. We are interested in the finished files, so we override the relevant Makefile portions to use "blib/lib/" instead.

This documentation is somewhat lacking - I'll try to improve it.

Because of the "Makefile" munging, this module might not work for distributions that use XS or SWIG.

If you talk about this module in blogs, on delicious.com or anywhere else, please use the "moduleinstalltemplate" tag.

No bugs have been reported.

Please report any bugs or feature requests to "bug-module-install-template@rt.cpan.org", or through the web interface at <http://rt.cpan.org>.

See perlmodinstall for information and options on installing Perl modules.

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a CPAN site near you. Or see <http://search.cpan.org/dist/Module-Install-Template/>.

Marcel Grünauer, "<marcel@cpan.org>"

Copyright 2007-2009 by Marcel Grünauer

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

2009-12-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.