202:2
  :   ˆl–ßi~””ÔD¨ 	¥íÀ3q—Å£¿„›eïa–ßi~”*j"Tâ�ÆÚ¸ÛªbÑ¿Ã 0ú    #!/usr/bin/perl -w
#========================================================================
#
# ttree
#
# DESCRIPTION
#   Script for processing all directory trees containing templates.
#   Template files are processed and the output directed to the 
#   relvant file in an output tree.  The timestamps of the source and
#   destination files can then be examined for future invocations 
#   to process only those files that have changed.  In other words,
#   it's a lot like 'make' for templates.
#
# AUTHOR
#   Andy Wardley   <abw@wardley.org>
#
# COPYRIGHT
#   Copyright (C) 1996-2013 Andy Wardley.  All Rights Reserved.
#   Copyright (C) 1998-2003 Canon Research Centre Europe Ltd.
#
#   This module is free software; you can redistribute it and/or
#   modify it under the same terms as Perl itself.
#
#========================================================================

use strict;
use Template::App::ttree;

my $ttree = Template::App::ttree->new;
$ttree->offer_create_a_sample_config_file();
$ttree->run();
exit(0);

__END__

#------------------------------------------------------------------------
# IMPORTANT NOTE
#   This documentation is generated automatically from source
#   templates.  Any changes you make here may be lost.
#
#   The 'docsrc' documentation source bundle is available for download
#   from http://www.template-toolkit.org/docs.html and contains all
#   the source templates, XML files, scripts, etc., from which the
#   documentation for the Template Toolkit is built.
#------------------------------------------------------------------------

=head1 NAME

Template::Tools::ttree - Process entire directory trees of templates

=head1 SYNOPSIS

    ttree [options] [files]

=head1 DESCRIPTION

The F<ttree> script is used to process entire directory trees containing
template files.  The resulting output from processing each file is then
written to a corresponding file in a destination directory.  The script
compares the modification times of source and destination files (where
they already exist) and processes only those files that have been modified.
In other words, it is the equivalent of 'make' for the Template Toolkit.

It supports a number of options which can be used to configure
behaviour, define locations and set Template Toolkit options.  The
script first reads the F<.ttreerc> configuration file in the HOME
directory, or an alternative file specified in the TTREERC environment
variable.  Then, it processes any command line arguments, including
any additional configuration files specified via the C<-f> (file)
option.

=head2 The F<.ttreerc> Configuration File

When you run F<ttree> for the first time it will ask you if you want
it to create a F<.ttreerc> file for you.  This will be created in your
home directory.

    $ ttree
    Do you want me to create a sample '.ttreerc' file for you?
    (file: /home/abw/.ttreerc)   [y/n]: y
    /home/abw/.ttreerc created.  Please edit accordingly and re-run ttree

The purpose of this file is to set any I<global> configuration options
that you want applied I<every> time F<ttree> is run. For example, you
can use the C<ignore> and C<copy> / C<link> options to provide regular
expressions that specify which files should be ignored and which
should be copied or linked rather than being processed as templates.
You may also want to set flags like C<verbose> and C<recurse>
according to your preference.

A minimal F<.ttreerc>:

    # ignore these files
    ignore = \b(CVS|RCS)\b
    ignore = ^#
    ignore = ~$

    # copy these files
    copy   = \.(gif|png|jpg|pdf)$

    # recurse into directories
    recurse

    # provide info about what's going on
    verbose

In most cases, you'll want to create a different F<ttree> configuration
file for each project you're working on.  The C<cfg> option allows you
to specify a directory where F<ttree> can find further configuration
files.

    cfg = /home/abw/.ttree

The C<-f> command line option can be used to specify which configuration
file should be us