1 #============================================================= -*-Perl-*-
7 # Perl bootstrap for XS module. Inherits methods from
8 # Template::Stash when not implemented in the XS module.
10 #========================================================================
12 package Template::Stash::XS;
23 @Template::Stash::XS::ISA = qw( DynaLoader Template::Stash );
26 bootstrap Template::Stash::XS $Template::VERSION;
29 die "Couldn't load Template::Stash::XS $Template::VERSION:\n\n$@\n";
39 # catch missing method calls here so perl doesn't barf
40 # trying to load *.al files
43 my ($self, @args) = @_;
50 die "Can't locate object method \"$auto\"" .
51 " via package \"$self\" at $c[1] line $c[2]\n";
60 Template::Stash::XS - High-speed variable stash written in C
65 use Template::Stash::XS;
67 my $stash = Template::Stash::XS->new(\%vars);
68 my $tt2 = Template->new({ STASH => $stash });
72 The Template:Stash::XS module is an implementation of the
73 Template::Stash written in C. The "XS" in the name refers to Perl's
74 XS extension system for interfacing Perl to C code. It works just
75 like the regular Perl implementation of Template::Stash but runs about
78 The easiest way to use the XS stash is to configure the Template
79 Toolkit to use it by default. You can do this at installation time
80 (when you run C<perl Makefile.PL>) by answering 'y' to the questions:
82 Do you want to build the XS Stash module? y
83 Do you want to use the XS Stash by default? y
85 See the F<INSTALL> file distributed with the Template Toolkit for further
86 details on installation.
88 If you don't elect to use the XS stash by default then you should use
89 the C<STASH> configuration item when you create a new Template object.
90 This should reference an XS stash object that you have created
94 use Template::Stash::XS;
96 my $stash = Template::Stash::XS->new(\%vars);
97 my $tt2 = Template->new({ STASH => $stash });
99 Alternately, you can set the C<$Template::Config::STASH> package
103 use Template::Config;
105 $Template::Config::STASH = 'Template::Stash::XS';
107 my $tt2 = Template->new();
109 The XS stash will then be automatically used.
111 If you want to use the XS stash by default and don't want to
112 re-install the Template Toolkit, then you can manually modify the
113 C<Template/Config.pm> module near line 42 to read:
115 $STASH = 'Template::Stash::XS';
119 Please report bugs to the Template Toolkit mailing list
120 templates@template-toolkit.org
124 Andy Wardley E<lt>abw@wardley.orgE<gt> L<http://wardley.org/>
126 Doug Steinwand E<lt>dsteinwand@citysearch.comE<gt>
130 Copyright (C) 1996-2009 Andy Wardley. All Rights Reserved.
132 This module is free software; you can redistribute it and/or
133 modify it under the same terms as Perl itself.