| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# ABSTRACT: Writer class for YAML::PP representing output data |
|
2
|
38
|
|
|
38
|
|
1971
|
use strict; |
|
|
38
|
|
|
|
|
94
|
|
|
|
38
|
|
|
|
|
1170
|
|
|
3
|
38
|
|
|
38
|
|
200
|
use warnings; |
|
|
38
|
|
|
|
|
81
|
|
|
|
38
|
|
|
|
|
9436
|
|
|
4
|
|
|
|
|
|
|
package YAML::PP::Writer; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.036_001'; # TRIAL VERSION |
|
7
|
|
|
|
|
|
|
|
|
8
|
3016
|
|
|
3016
|
1
|
6812
|
sub output { return $_[0]->{output} } |
|
9
|
6767
|
|
|
6767
|
1
|
14553
|
sub set_output { $_[0]->{output} = $_[1] } |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
|
12
|
5098
|
|
|
5098
|
1
|
27718
|
my ($class, %args) = @_; |
|
13
|
5098
|
|
|
|
|
7892
|
my $output = delete $args{output}; |
|
14
|
5098
|
100
|
|
|
|
11329
|
$output = '' unless defined $output; |
|
15
|
5098
|
|
|
|
|
18351
|
return bless { |
|
16
|
|
|
|
|
|
|
output => $output, |
|
17
|
|
|
|
|
|
|
}, $class; |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub write { |
|
21
|
12751
|
|
|
12751
|
1
|
23551
|
my ($self, $line) = @_; |
|
22
|
12751
|
|
|
|
|
37511
|
$self->{output} .= $line; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub init { |
|
26
|
5191
|
|
|
5191
|
1
|
10277
|
$_[0]->set_output(''); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub finish { |
|
30
|
1576
|
|
|
1576
|
1
|
2554
|
my ($self) = @_; |
|
31
|
1576
|
|
|
|
|
3036
|
$_[0]->set_output(undef); |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |