File Coverage

lib/Template/Stash/XS.pm
Criterion Covered Total %
statement 18 25 72.0
branch 1 2 50.0
condition n/a
subroutine 6 7 85.7
pod n/a
total 25 34 73.5


line stmt bran cond sub pod time code
1             #============================================================= -*-Perl-*-
2             #
3             # Template::Stash::XS
4             #
5             # DESCRIPTION
6             #
7             # Perl bootstrap for XS module. Inherits methods from
8             # Template::Stash when not implemented in the XS module.
9             #
10             #========================================================================
11              
12             package Template::Stash::XS;
13              
14 74     74   2125 use strict;
  74         156  
  74         3176  
15 74     74   421 use warnings;
  74         150  
  74         2510  
16 74     74   399 use Template;
  74         143  
  74         1748  
17 74     74   43285 use Template::Stash;
  74         235  
  74         9031  
18              
19             our $AUTOLOAD;
20              
21             BEGIN {
22 74     74   752 require DynaLoader;
23 74         1762 @Template::Stash::XS::ISA = qw( DynaLoader Template::Stash );
24              
25 74         220 eval {
26 74         45309 bootstrap Template::Stash::XS $Template::VERSION;
27             };
28 74 50       13755 if ($@) {
29 0         0 die "Couldn't load Template::Stash::XS $Template::VERSION:\n\n$@\n";
30             }
31             }
32              
33             sub DESTROY {
34             # no op
35 1439     1439   15408 1;
36             }
37              
38              
39             # catch missing method calls here so perl doesn't barf
40             # trying to load *.al files
41              
42             sub AUTOLOAD {
43 0     0     my ($self, @args) = @_;
44 0           my @c = caller(0);
45 0           my $auto = $AUTOLOAD;
46              
47 0           $auto =~ s/.*:://;
48 0           $self =~ s/=.*//;
49              
50 0           die "Can't locate object method \"$auto\"" .
51             " via package \"$self\" at $c[1] line $c[2]\n";
52             }
53              
54             1;
55              
56             __END__