1Template::Stash::XS(3)User Contributed Perl DocumentationTemplate::Stash::XS(3)
2
3
4
6 Template::Stash::XS - High-speed variable stash written in C
7
9 use Template;
10 use Template::Stash::XS;
11
12 my $stash = Template::Stash::XS->new(\%vars);
13 my $tt2 = Template->new({ STASH => $stash });
14
16 The Template:Stash::XS module is an implementation of the
17 Template::Stash written in C. The "XS" in the name refers to Perl's XS
18 extension system for interfacing Perl to C code. It works just like
19 the regular Perl implementation of Template::Stash but runs about twice
20 as fast.
21
22 The easiest way to use the XS stash is to configure the Template
23 Toolkit to use it by default. You can do this at installation time
24 (when you run "perl Makefile.PL") by answering 'y' to the questions:
25
26 Do you want to build the XS Stash module? y
27 Do you want to use the XS Stash by default? y
28
29 See the INSTALL file distributed with the Template Toolkit for further
30 details on installation.
31
32 If you don't elect to use the XS stash by default then you should use
33 the "STASH" configuration item when you create a new Template object.
34 This should reference an XS stash object that you have created
35 manually.
36
37 use Template;
38 use Template::Stash::XS;
39
40 my $stash = Template::Stash::XS->new(\%vars);
41 my $tt2 = Template->new({ STASH => $stash });
42
43 Alternately, you can set the $Template::Config::STASH package variable
44 like so:
45
46 use Template;
47 use Template::Config;
48
49 $Template::Config::STASH = 'Template::Stash::XS';
50
51 my $tt2 = Template->new();
52
53 The XS stash will then be automatically used.
54
55 If you want to use the XS stash by default and don't want to re-install
56 the Template Toolkit, then you can manually modify the
57 "Template/Config.pm" module near line 42 to read:
58
59 $STASH = 'Template::Stash::XS';
60
62 Please report bugs to the Template Toolkit mailing list
63 templates@template-toolkit.org
64
66 Andy Wardley <abw@wardley.org> <http://wardley.org/>
67
68 Doug Steinwand <dsteinwand@citysearch.com>
69
71 Copyright (C) 1996-2009 Andy Wardley. All Rights Reserved.
72
73 This module is free software; you can redistribute it and/or modify it
74 under the same terms as Perl itself.
75
77 Template::Stash
78
79
80
81perl v5.12.0 2009-04-07 Template::Stash::XS(3)