SPUG: Template Toolkit and Module::Build

Ingy dot Net ingy at ingy.net
Sun Nov 28 03:36:06 PST 2010

Why do you want Module::Build? Module::Install makes everything trivial.

use inc::Module::Install;
install_script 'bin/foo';

File::ShareDir finds files under share/ after they are installed.

On Sun, Nov 28, 2010 at 12:21 PM, Michael R. Wolf <MichaelRWolf at att.net>wrote:

> Anyone used TT2 and Module::Build together?
> I'm looking for a (non-web) set of best (or at least OK) practices that
> works with Module::Build.  I'm familiar with the basics of Build.PL for
> creating and installing a module (or 3), but could use some guidance for the
> "ancillary" pieces of a distribution that needs run-time non-module parts.
> By "best practice", I mean a combination of practices in client code,
> Build.PL, and directory structure that works well with
>  - Build && Build test  # regression testing
>  - perl -I blib/lib t/xxx.t     # debugging modules
>  - perl -I blib/lib bin/main.pl
>  - Build dist                   # distribution
>  - Build install                        # client installation
> * Where did you put the templates (*.tt) and the stand-alone Perl programs
> (*.pl) relative to Dist-Name/lib/Dist/Name.pm?
> * How did that change from development to deployment?
> * How did the 'main' program reference the the template directories in
> Template->new( { INCLUDE_PATH => [dir1 dir2] } )?
> * What sections did you use in Build.PL to make sure the *.pl and *.tt
> files worked with Build targes of 'test', 'dist', and 'install'?
> * Was $FindBin::Bin/../dir1/dir2 a part of the solution? Or was there some
> library-relative piece?
> It might be instructive to me (and others) to do a 'ls -r' in a new
> distribution, and various cut/paste references to *.tt and *.pl from
> Build.pl and main-program.pl.
> Alternatively, a URL to a better description of Buld.PL (no, not how to
> sub-class it, how to *use* it as it is -- just my beef with the "Cookbook"
> and "Authoring".  OK end mini-rant)
> ...Or a suggestion of a CPAN module that does it well.
> Thanks...
> --
> Michael R. Wolf
>    All mammals learn by playing!
>        MichaelRWolf at att.net
> _____________________________________________________________
> Seattle Perl Users Group Mailing List
>     POST TO: spug-list at pm.org
> SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list
>    MEETINGS: 3rd Tuesdays
>    WEB PAGE: http://seattleperl.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/spug-list/attachments/20101128/c8d301ca/attachment.html>

More information about the spug-list mailing list