#============================================================= -*-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