line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::IO::All; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
76459
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
5
|
use base qw( Template::Plugin ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
758
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
800
|
use IO::All; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
12
|
|
7
|
|
|
|
|
|
|
#use Data::Dumper; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$Template::Plugin::IO::All::VERSION = '0.01'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub load { |
12
|
1
|
|
|
1
|
1
|
18
|
my ($class, $context) = @_; |
13
|
1
|
|
|
|
|
7
|
bless { |
14
|
|
|
|
|
|
|
_CONTEXT => $context, |
15
|
|
|
|
|
|
|
}, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
3
|
|
|
3
|
1
|
717
|
my ($self, $context, @params) = @_; |
20
|
3
|
100
|
66
|
|
|
24
|
if($context and not ref $context){ |
21
|
2
|
|
|
|
|
9
|
$self->{_io} = io($context); |
22
|
|
|
|
|
|
|
} |
23
|
3
|
|
|
|
|
42882
|
$self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub AUTOLOAD { |
28
|
8
|
|
|
8
|
|
37397
|
my $sub = $Template::Plugin::IO::All::AUTOLOAD; |
29
|
8
|
|
|
|
|
36
|
$sub =~ s/^Template::Plugin::IO::All:://o; |
30
|
|
|
|
|
|
|
# print "[$sub]\n"; |
31
|
|
|
|
|
|
|
|
32
|
8
|
100
|
|
|
|
63
|
if($sub =~ /^([+\-]?\d+)$/){ # Access content on a certain line |
|
|
50
|
|
|
|
|
|
33
|
1
|
|
|
|
|
5
|
shift->{_io}->[$1]; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
elsif($sub ne 'DESTROY'){ |
36
|
7
|
|
|
|
|
61
|
shift->{_io}->$sub(@_); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |