line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
113057
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
57
|
|
2
|
|
|
|
|
|
|
package Template::Plugin::Class; |
3
|
1
|
|
|
1
|
|
8
|
use base 'Template::Plugin'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
934
|
|
4
|
1
|
|
|
1
|
|
728
|
use vars qw( $VERSION ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
136
|
|
5
|
|
|
|
|
|
|
$VERSION = '0.14'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
1
|
|
|
1
|
1
|
41
|
my $class = shift; |
9
|
1
|
|
|
|
|
2
|
my $context = shift; |
10
|
1
|
|
|
|
|
2
|
my $arg = shift; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# stolen from base.pm |
13
|
1
|
|
|
|
|
54
|
eval "require $arg"; |
14
|
|
|
|
|
|
|
# Only ignore "Can't locate" errors from our eval require. |
15
|
|
|
|
|
|
|
# Other fatal errors (syntax etc) must be reported. |
16
|
1
|
|
|
|
|
4
|
(my $filename = $arg) =~ s!::!/!g; |
17
|
1
|
50
|
33
|
|
|
7
|
die if $@ && $@ !~ /Can't locate \Q$filename\E\.pm/; |
18
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
108
|
|
19
|
1
|
50
|
|
|
|
1
|
unless (%{"$arg\::"}) { |
|
1
|
|
|
|
|
6
|
|
20
|
0
|
|
|
|
|
0
|
require Carp; |
21
|
0
|
|
|
|
|
0
|
Carp::croak("Package \"$arg\" is empty.\n", |
22
|
|
|
|
|
|
|
"\t(Perhaps you need to 'use' the module ", |
23
|
|
|
|
|
|
|
"which defines that package first.)"); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
6
|
return bless \$arg, 'Template::Plugin::Class::Proxy'; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
package Template::Plugin::Class::Proxy; |
30
|
1
|
|
|
1
|
|
5
|
use vars qw( $AUTOLOAD ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
105
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub AUTOLOAD { |
33
|
1
|
|
|
1
|
|
43
|
my $self = shift; |
34
|
1
|
|
|
|
|
2
|
my $class = ref $self; |
35
|
1
|
|
|
|
|
17
|
my ($method) = ($AUTOLOAD =~ /^$class\::(.*)/); |
36
|
1
|
|
|
|
|
10
|
$$self->$method(@_); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
0
|
|
|
sub DESTROY {} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |