晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 sh-3ll

HOME


sh-3ll 1.0
DIR:/proc/thread-self/root/usr/local/lib64/perl5/Template/Stash/
Upload File :
Current File : //proc/thread-self/root/usr/local/lib64/perl5/Template/Stash/XS.pm
#============================================================= -*-Perl-*-
#
# Template::Stash::XS
#
# DESCRIPTION
#
#   Perl bootstrap for XS module. Inherits methods from
#   Template::Stash when not implemented in the XS module.
#
#========================================================================

package Template::Stash::XS;

use strict;
use warnings;
use Template;
use Template::Stash;
use XSLoader;

our $AUTOLOAD;

our @ISA = qw( Template::Stash );

XSLoader::load 'Template::Stash::XS', $Template::VERSION;

sub DESTROY {
    # no op
    1;
}

# catch missing method calls here so perl doesn't barf
# trying to load *.al files

sub AUTOLOAD {
    my ($self, @args) = @_;
    my @c             = caller(0);
    my $auto	    = $AUTOLOAD;

    $auto =~ s/.*:://;
    $self =~ s/=.*//;

    die "Can't locate object method \"$auto\"" .
        " via package \"$self\" at $c[1] line $c[2]\n";
}

1;

__END__

=head1 NAME

Template::Stash::XS - High-speed variable stash written in C

=head1 SYNOPSIS

    use Template;
    use Template::Stash::XS;

    my $stash = Template::Stash::XS->new(\%vars);
    my $tt2   = Template->new({ STASH => $stash });

=head1 DESCRIPTION

The Template:Stash::XS module is an implementation of the
Template::Stash written in C.  The "XS" in the name refers to Perl's
XS extension system for interfacing Perl to C code.  It works just
like the regular Perl implementation of Template::Stash but runs about
twice as fast.

The easiest way to use the XS stash is to configure the Template
Toolkit to use it by default.  You can do this at installation time
(when you run C<perl Makefile.PL>) by answering 'y' to the questions:

    Do you want to build the XS Stash module?      y
    Do you want to use the XS Stash by default?    y

See the F<INSTALL> file distributed with the Template Toolkit for further
details on installation.

If you don't elect to use the XS stash by default then you should use
the C<STASH> configuration item when you create a new Template object.
This should reference an XS stash object that you have created
manually.

    use Template;
    use Template::Stash::XS;

    my $stash = Template::Stash::XS->new(\%vars);
    my $tt2   = Template->new({ STASH => $stash });

Alternately, you can set the C<$Template::Config::STASH> package
variable like so:

    use Template;
    use Template::Config;

    $Template::Config::STASH = 'Template::Stash::XS';

    my $tt2 = Template->new();

The XS stash will then be automatically used.

If you want to use the XS stash by default and don't want to
re-install the Template Toolkit, then you can manually modify the
C<Template/Config.pm> module near line 42 to read:

    $STASH = 'Template::Stash::XS';

=head1 BUGS

Please report bugs to the Template Toolkit mailing list
templates@template-toolkit.org

=head1 AUTHORS

Andy Wardley E<lt>abw@wardley.orgE<gt> L<http://wardley.org/>

Doug Steinwand E<lt>dsteinwand@citysearch.comE<gt>

=head1 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 SEE ALSO

L<Template::Stash>