3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
6
<title>Template::Stash::XS</title>
7
<link rel="stylesheet" type="text/css" href="../../../css/blue.css" title="Clear Blue">
8
<link rel="alternate stylesheet" type="text/css" href="../../../css/orange.css" title="Clear Orange">
9
<link rel="alternate stylesheet" type="text/css" href="../../../css/green.css" title="Clear Green">
10
<link rel="alternate stylesheet" type="text/css" href="../../../css/purple.css" title="Clear Purple">
11
<link rel="alternate stylesheet" type="text/css" href="../../../css/grey.css" title="Clear Grey">
13
<link rel="stylesheet" type="text/css" href="../../../css/ie6.css" />
15
<link rel="stylesheet" type="text/css" href="/css/print.css" media="print">
16
<script type="text/javascript" src="../../../js/tt2.js"></script>
17
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
18
<meta name="author" content="Andy Wardley">
23
<a href="../../../index.html" id="logo" alt="" title="Click for the Home Page"><span class="alt">TT2 Home Page</span></a>
25
<li><a href="../../../modules/index.html">Modules</a></li>
26
<li><a href="../../../modules/Template/index.html">Template::*</a></li>
27
<li><a href="../../../modules/Template/Stash/index.html">Stash::*</a></li>
28
<li class="last"><a href="../../../modules/Template/Stash/XS.html">XS.pm</a></li>
30
<div class="controls">
31
<a href="#" class="menu show" onclick="widescreen_off(); return false" title="Show Menu">
32
<span class="about">Click to view the menu. It's very nice.</span>
34
<a href="#" class="menu hide" onclick="widescreen_on(); return false" title="Hide Menu">
35
<span class="about">Click to hide the menu and go all widescreen!</span>
39
<a href="../../../modules/Template/Stash/Context.html" title="Template::Stash::Context" class="go back">Back<span class="about"><h4>Template::Stash::Context</h4>Experimetal stash allowing list/scalar context definition</span></a>
40
<a href="../../../modules/Template/Stash/index.html" title="Template::Stash::* Modules" class="go up">Up<span class="about"><h4>Template::Stash::* Modules</h4></span></a>
41
<span class="go next">Next<span class="about">My name is <i>Meles Meles</i>, but you can call me "Badger".</span></span>
44
<h1 class="headline">Template::Stash::XS</h1>
45
<h2 class="subhead">High-speed variable stash written in C</h1>
50
<a href="../../../index.html" id="logo"></a>
53
<li class="l0 first"><a href="../../../manual/index.html">Manual</a></li>
54
<li class="l0"><a href="../../../modules/index.html" class="warm">Modules</a></li>
55
<li class="l1"><a href="../../../modules/Template.html">Template.pm</a></li>
56
<li class="l1"><a href="../../../modules/Template/index.html" class="warm">Template::*</a></li>
57
<li class="l2"><a href="../../../modules/Template/Base.html">Base.pm</a></li>
58
<li class="l2"><a href="../../../modules/Template/Config.html">Config.pm</a></li>
59
<li class="l2"><a href="../../../modules/Template/Constants.html">Constants.pm</a></li>
60
<li class="l2"><a href="../../../modules/Template/Context.html">Context.pm</a></li>
61
<li class="l2"><a href="../../../modules/Template/Directive.html">Directive.pm</a></li>
62
<li class="l2"><a href="../../../modules/Template/Document.html">Document.pm</a></li>
63
<li class="l2"><a href="../../../modules/Template/Exception.html">Exception.pm</a></li>
64
<li class="l2"><a href="../../../modules/Template/Filters.html">Filters.pm</a></li>
65
<li class="l2"><a href="../../../modules/Template/Grammar.html">Grammar.pm</a></li>
66
<li class="l2"><a href="../../../modules/Template/Iterator.html">Iterator.pm</a></li>
67
<li class="l2"><a href="../../../modules/Template/Namespace/index.html">Namespace::*</a></li>
68
<li class="l2"><a href="../../../modules/Template/Parser.html">Parser.pm</a></li>
69
<li class="l2"><a href="../../../modules/Template/Plugin.html">Plugin.pm</a></li>
70
<li class="l2"><a href="../../../modules/Template/Plugin/index.html">Plugin::*</a></li>
71
<li class="l2"><a href="../../../modules/Template/Plugins.html">Plugins.pm</a></li>
72
<li class="l2"><a href="../../../modules/Template/Provider.html">Provider.pm</a></li>
73
<li class="l2"><a href="../../../modules/Template/Service.html">Service.pm</a></li>
74
<li class="l2"><a href="../../../modules/Template/Stash.html">Stash.pm</a></li>
75
<li class="l2"><a href="../../../modules/Template/Stash/index.html" class="warm">Stash::*</a></li>
76
<li class="l3"><a href="../../../modules/Template/Stash/Context.html">Context.pm</a></li>
77
<li class="l3"><a href="../../../modules/Template/Stash/XS.html" class="warm">XS.pm</a></li>
78
<li class="l2"><a href="../../../modules/Template/Test.html">Test.pm</a></li>
79
<li class="l2"><a href="../../../modules/Template/VMethods.html">VMethods.pm</a></li>
80
<li class="l2"><a href="../../../modules/Template/View.html">View.pm</a></li>
81
<li class="l0"><a href="../../../tools/index.html">Tools</a></li>
82
<li class="l0 last"><a href="../../../tutorial/index.html">Tutorial</a></li>
84
<div class="foot"></div>
90
<h1 id="contents" onclick="switch_section(this)" title="Click title to show/hide section content.">Contents</h1>
91
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
95
<li class=""><a href="#SYNOPSIS">SYNOPSIS</a></li>
96
<li class=""><a href="#DESCRIPTION">DESCRIPTION</a></li>
97
<li class=""><a href="#BUGS">BUGS</a></li>
98
<li class=""><a href="#AUTHORS">AUTHORS</a></li>
99
<li class=""><a href="#VERSION">VERSION</a></li>
100
<li class=""><a href="#COPYRIGHT">COPYRIGHT</a></li>
101
<li class=""><a href="#SEE_ALSO">SEE ALSO</a></li>
108
<div class="section">
110
<h1 id="SYNOPSIS" onclick="switch_section(this)" title="Click title to show/hide section content.">SYNOPSIS</h1>
111
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
115
use Template::Stash::XS;</pre>
116
<pre>my $stash = Template::Stash::XS->new(\%vars);
117
my $tt2 = Template->new({ STASH => $stash });</pre>
120
<div class="section">
122
<h1 id="DESCRIPTION" onclick="switch_section(this)" title="Click title to show/hide section content.">DESCRIPTION</h1>
123
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
127
The Template:Stash::XS module is an implementation of the Template::Stash
128
written in C. The "XS" in the name refers to Perl's XS extension system
129
for interfacing Perl to C code. It works just like the regular Perl
130
implementation of Template::Stash but runs about twice as fast.
133
The easiest way to use the XS stash is to configure the Template Toolkit
134
to use it by default. You can do this at installation time (when you run
135
<code>perl Makefile.PL</code>) by answering 'y' to the questions:
137
<pre>Do you want to build the XS Stash module? y
138
Do you want to use the XS Stash by default? y</pre>
140
See the <i>INSTALL</i> file distributed with the Template Toolkit for
141
further details on installation.
144
If you don't elect to use the XS stash by default then you should use the
145
<code>STASH</code> configuration item when you create a new Template
146
object. This should reference an XS stash object that you have created
150
use Template::Stash::XS;</pre>
151
<pre>my $stash = Template::Stash::XS->new(\%vars);
152
my $tt2 = Template->new({ STASH => $stash });</pre>
154
Alternately, you can set the <code>$Template::Config::STASH</code>
155
package variable like so:
158
use Template::Config;</pre>
159
<pre>$Template::Config::STASH = 'Template::Stash::XS';</pre>
160
<pre>my $tt2 = Template->new();</pre>
162
The XS stash will then be automatically used.
165
If you want to use the XS stash by default and don't want to re-install
166
the Template Toolkit, then you can manually modify the
167
<code>Template/Config.pm</code> module near line 42 to read:
169
<pre>$STASH = 'Template::Stash::XS';</pre>
172
<div class="section">
174
<h1 id="BUGS" onclick="switch_section(this)" title="Click title to show/hide section content.">BUGS</h1>
175
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
179
Please report bugs to the Template Toolkit mailing list
180
templates@template-toolkit.org
184
<div class="section">
186
<h1 id="AUTHORS" onclick="switch_section(this)" title="Click title to show/hide section content.">AUTHORS</h1>
187
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
191
Andy Wardley <abw@tt2.org>
194
Doug Steinwand <dsteinwand@citysearch.com>
198
<div class="section">
200
<h1 id="VERSION" onclick="switch_section(this)" title="Click title to show/hide section content.">VERSION</h1>
201
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
205
Template Toolkit version 2.19, released on 27 April 2007.
209
<div class="section">
211
<h1 id="COPYRIGHT" onclick="switch_section(this)" title="Click title to show/hide section content.">COPYRIGHT</h1>
212
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
215
<pre>Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.</pre>
217
This module is free software; you can redistribute it and/or modify it
218
under the same terms as Perl itself.
222
<div class="section">
224
<h1 id="SEE_ALSO" onclick="switch_section(this)" title="Click title to show/hide section content.">SEE ALSO</h1>
225
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
229
<a href="../../../modules/Template/Stash.html">Template::Stash</a>
236
<div class="pageinfo">
237
/modules/Template/Stash/XS.html last modified 10:55:09 31-May-2007
242
<a href="http://opensource.org/" class="osi"></a>
243
<div class="controls">
245
<a href="../../../modules/Template/Stash/Context.html" title="Template::Stash::Context" class="go back">Back<span class="about"><h4>Template::Stash::Context</h4></span></a>
246
<a href="../../../modules/Template/Stash/index.html" title="Template::Stash::* Modules" class="go up">Up<span class="about"><h4>Template::Stash::* Modules</h4></span></a>
247
<span class="go next">Next<span class="about"></span></span>
250
<div class="copyright">
251
Copyright © 1996-2007 <a href="http://wardley.org/">Andy Wardley</a>. All Rights Reserved.
253
<div class="licence">
254
The <a href="http://template-toolkit.org/">Template Toolkit</a> is <a href="http://opensource.org/">Open Source</a> software.
255
You can redistribute and/or modify it under the terms of the <a href="http://www.opensource.org/licenses/gpl-license.php">GNU Public Licence</a>
256
or the <a href="http://www.opensource.org/licenses/artistic-license.php">Perl Artistic Licence</a>.
261
<li class="first"><a href="#" class="blue" onclick="set_style('Clear Blue')"></a></li>
262
<li><a href="#" class="orange" onclick="set_style('Clear Orange')"></a></li>
263
<li><a href="#" class="green" onclick="set_style('Clear Green')"></a></li>
264
<li><a href="#" class="purple" onclick="set_style('Clear Purple')"></a></li>
265
<li><a href="#" class="grey" onclick="set_style('Clear Grey')"></a></li>