/usr/share/perl5/Spoon/Template/TT2.pm is in libspoon-perl 0.24-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | package Spoon::Template::TT2;
use Spoon::Template -Base;
field template_object =>
-init => '$self->create_template_object';
sub compile_dir {
my $dir = $self->plugin_directory . '/ttc';
mkdir $dir unless -d $dir;
return $dir;
}
sub create_template_object {
require Template;
# XXX Make template caching a configurable option
Template->new({
INCLUDE_PATH => $self->path,
TOLERANT => 0,
COMPILE_DIR => $self->compile_dir,
COMPILE_EXT => '.ttc',
});
}
sub render {
my $template = shift;
my $output;
my $t = $self->template_object;
eval {
$t->process($template, {@_}, \$output) or die $t->error;
};
die "Template Toolkit error:\n$@" if $@;
return $output;
}
__DATA__
=head1 NAME
Spoon::Template::TT2 - Spoon Template Toolkit Base Class
=head1 SYNOPSIS
=head1 DESCRIPTION
=head1 AUTHOR
Brian Ingerson <INGY@cpan.org>
=head1 COPYRIGHT
Copyright (c) 2004. Brian Ingerson. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
=cut
|