晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
| DIR:/proc/thread-self/root/usr/local/lib64/perl5/Template/ |
| Current File : //proc/thread-self/root/usr/local/lib64/perl5/Template/Modules.pod |
#============================================================= -*-perl-*-
#
# Template::Modules
#
# DESCRIPTION
#
# AUTHOR
# Andy Wardley <abw@wardley.org>
#
# COPYRIGHT
# Copyright (C) 1996-2022 Andy Wardley. All Rights Reserved.
#
# This module is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
#========================================================================
=head1 NAME
Template::Modules - Template Toolkit Modules
=head1 Template Toolkit Modules
This documentation provides an overview of the different modules that
comprise the Template Toolkit.
=head2 Template
The L<Template> module is the front-end to the Template Toolkit for
Perl programmers.
use Template;
my $tt = Template->new();
$tt->process('hello.html', message => 'Hello World');
=head2 Template::Base
The L<Template::Base> module implements a base class from which the other
Template Toolkit modules are derived. It implements common functionality
for creating objects, error reporting, debugging, and so on.
=head2 Template::Config
The L<Template::Config> module defines the configuration of the Template
Toolkit for your system. It is an example of a I<factory module> which is
responsible for instantiating the various other modules used in the Template
Toolkit.
For example, the L<Template::Config> module defines the C<$STASH> package
variable which indicates which version of the L<Template::Stash> you are
using by default. If you elected to use the faster L<XS|Template::Stash::XS>
stash when you installed the Template Toolkit, then this will be set as:
$STASH = 'Template::Stash::XS';
Otherwise you'll get the regular L<Perl|Template::Stash> stash:
$STASH = 'Template::Stash';
This approach means that other parts of the Template Toolkit don't have to
worry about which stash you're using. They just ask the L<Template::Config>
module to create a stash of the right kind.
=head2 Template::Constants
The L<Template::Constants> defines a number of constants that are used by
the Template Toolkit.
For example, the C<:chomp> tagset defines the C<CHOMP_???> constants that
can be used with the C<PRE_CHOMP> and C<POST_CHOMP> configuration options.
use Template::Constants ':chomp';
my $tt = Template->new({
PRE_CHOMP => CHOMP_COLLAPSE,
});
=head2 Template::Context
The L<Template::Context> module defines a runtime context in which templates
are processed. A context keeps track of all the templates, variables, plugins,
and other resources that are available (either directly or through delegate
objects) and provides methods to fetch, store, and perform various operations
on them.
=head2 Template::Document
The L<Template::Document> module implements a compiled template document
object. This is generated by the L<Template::Parser> module.
=head2 Template::Exception
The L<Template::Exception> module implements an exception object which
is used for runtime error reporting.
=head2 Template::Filters
The L<Template::Filters> module implements a filter provider. It includes
the core collection of filters that can be used via the C<FILTER> directive.
=head2 Template::Iterator
The L<Template::Iterator> module implements a data iterator which steps
through each item in a list in turn. It is used by the C<FOREACH> directive.
Within a C<FOREACH> block, the C<loop> variable always references the
current iterator object.
[% FOREACH item IN list;
IF loop.first;
# first item in loop
ELSIF loop.last;
# last item in loop
ELSE;
# any other item in loop
END;
END
%]
=head2 Template::Namespace::Constants
The L<Template::Namespace::Constants> module is used internally to represent
constants. These can be resolved immediately at the point that a template is
compiled.
=head2 Template::Parser
The L<Template::Parser> module is used to parse a source template and turn it
into Perl code which can be executed.
=head2 Template::Plugin
The L<Template::Plugin> module is a base class for Template Toolkit plugins
that can be loaded on demand from within a template using the C<USE> directive.
=head2 Template::Plugins
The L<Template::Plugins> module is the plugins provider. It loads and prepares
plugins as and when they are requested from within a template.
=head2 Template::Provider
The L<Template::Provider> module is responsible for loading, compiling and
caching templates.
=head2 Template::Service
The L<Template::Service> module implements a service layer that sits just
behind the L<Template> module, and just in front of a L<Template::Context>. It
handles each request to process a template (forwarded from the L<Template>
module). It adds any headers and/or footers (specified via the C<PRE_PROCESS>
and C<POST_PROCESS> options), applies any wrapper (the C<WRAPPER> option) and
catches any errors returned (the C<ERRORS> option).
=head2 Template::Stash
The L<Template::Stash> module is used to fetch and store template variables.
It implements all of the magic associated with the dot operator.
=head2 Template::Stash::XS
The L<Template::Stash::XS> module is a high-speed implementation of
L<Template::Stash> written in C.
=head2 Template::Test
The L<Template::Test> module is used to automate the Template Toolkit
test scripts.
=cut
# Local Variables:
# mode: perl
# perl-indent-level: 4
# indent-tabs-mode: nil
# End:
#
# vim: expandtab shiftwidth=4:
|