| 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 | use strict; | ||
| 15 | use warnings; | ||
| 16 | use Template; | ||
| 17 | use Template::Stash; | ||
| 18 | use XSLoader; | ||
| 19 | |||
| 20 | our $AUTOLOAD; | ||
| 21 | |||
| 22 | our @ISA = qw( Template::Stash ); | ||
| 23 | |||
| 24 | XSLoader::load 'Template::Stash::XS', $Template::VERSION; | ||
| 25 | |||
| 26 | sub DESTROY { | ||
| 27 | # no op | ||
| 28 | 1; | ||
| 29 | } | ||
| 30 | |||
| 31 | # catch missing method calls here so perl doesn't barf | ||
| 32 | # trying to load *.al files | ||
| 33 | |||
| 34 | sub AUTOLOAD { | ||
| 35 | my ($self, @args) = @_; | ||
| 36 | my @c = caller(0); | ||
| 37 | my $auto = $AUTOLOAD; | ||
| 38 | |||
| 39 | $auto =~ s/.*:://; | ||
| 40 | $self =~ s/=.*//; | ||
| 41 | |||
| 42 | die "Can't locate object method \"$auto\"" . | ||
| 43 | " via package \"$self\" at $c[1] line $c[2]\n"; | ||
| 44 | } | ||
| 45 | |||
| 46 | 1; | ||
| 47 | |||
| 48 | __END__ |