| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::PRT::Collector::FileHandle; |
|
2
|
2
|
|
|
2
|
|
1112
|
use strict; |
|
|
2
|
|
|
|
|
2
|
|
|
|
2
|
|
|
|
|
42
|
|
|
3
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
|
2
|
|
|
|
|
2
|
|
|
|
2
|
|
|
|
|
42
|
|
|
4
|
2
|
|
|
2
|
|
5
|
use File::Temp qw(tempdir tempfile); |
|
|
2
|
|
|
|
|
2
|
|
|
|
2
|
|
|
|
|
312
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
|
7
|
3
|
|
|
3
|
0
|
12802
|
my ($class, $input_fh) = @_; |
|
8
|
|
|
|
|
|
|
|
|
9
|
3
|
|
|
|
|
14
|
bless { |
|
10
|
|
|
|
|
|
|
input_fh => $input_fh, |
|
11
|
|
|
|
|
|
|
}, $class; |
|
12
|
|
|
|
|
|
|
} |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub collect { |
|
15
|
1
|
|
|
1
|
0
|
2
|
my ($self) = @_; |
|
16
|
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
3
|
my $input_fh = $self->{input_fh}; |
|
18
|
1
|
|
|
|
|
1
|
my $content = do { local $/; <$input_fh> }; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
18
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
3
|
my $dir = tempdir( CLEANUP => 1 ); |
|
21
|
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
256
|
my ($fh, $file) = tempfile('prt-XXXX', DIR => $dir, SUFFIX => '.pm'); |
|
23
|
1
|
|
|
|
|
199
|
$self->{dir} = $dir; |
|
24
|
1
|
|
|
|
|
1
|
$self->{file} = $file; |
|
25
|
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
9
|
print $fh $content; |
|
27
|
1
|
|
|
|
|
19
|
close $fh; |
|
28
|
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
10
|
[ $file ]; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |