Templat...tash::XS(3)
π Templat...tash::XS(3) β aka Template::Stash::XS β the manual, but make it make sense π
okay so bestie, this is a User Contributed Perl Documentation page. The manual name up top is the very truncated Templat...tash::XS(3), and the actual module we're talking about is Template::Stash::XS. Yes, the header is giving ellipsis drama, but we move. π«Ά
πΈ NAME πΈ
Template::Stash::XS β high-speed variable stash written in C. That's the whole name vibe: fast stash, C energy, no cap. π
β¨ SYNOPSIS β¨
use Template;
use Template::Stash::XS;
my $stash = Template::Stash::XS->new(\%vars);
my $tt2 = Template->new({ STASH => $stash });
π DESCRIPTION π
The Template:Stash::XS module β yep, the original page has one colon there, and I'm preserving it exactly, no sneaky edits π β is an implementation of 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. slay. π₯
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 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 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 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 $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. automatic icon behavior, we love to see it. β¨
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 Template/Config.pm module near line 42 to read:
$STASH = 'Template::Stash::XS';
π BUGS π
Please report bugs to the Template Toolkit mailing list templates@template-toolkit.org. don't be shy, bestie, that's literally what it's for π
π AUTHORS π
- Andy Wardley
<abw@wardley.org><http://wardley.org/> - Doug Steinwand
<dsteinwand@citysearch.com>
π 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. free software rights, periodt. π«Ά
π SEE ALSO π
Template::Stash
kisses and a cute little footer moment: this page's footer says perl v5.42.0 and 2024-06-23, with the truncated Templat...tash::XS(3) label doing its thing. mwah. π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Template-Toolkit 3.102.0-bp160.1.13 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Template-Toolkit 3.102.0-bp160.1.13 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Template-Toolkit 3.102.0-bp160.1.13 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Template-Toolkit 3.102.0-bp160.1.13 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms