line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pod::Tree::Stream; |
2
|
19
|
|
|
19
|
|
3849703
|
use 5.006; |
|
19
|
|
|
|
|
89
|
|
3
|
19
|
|
|
19
|
|
133
|
use strict; |
|
19
|
|
|
|
|
40
|
|
|
19
|
|
|
|
|
462
|
|
4
|
19
|
|
|
19
|
|
105
|
use warnings; |
|
19
|
|
|
|
|
56
|
|
|
19
|
|
|
|
|
4734
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.30'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
77
|
|
|
77
|
0
|
222
|
my ( $package, $fh ) = @_; |
10
|
|
|
|
|
|
|
|
11
|
77
|
|
|
|
|
263
|
my $stream = { |
12
|
|
|
|
|
|
|
fh => $fh, |
13
|
|
|
|
|
|
|
line => '' |
14
|
|
|
|
|
|
|
}; |
15
|
|
|
|
|
|
|
|
16
|
77
|
|
|
|
|
238
|
bless $stream, $package; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub get_paragraph { |
20
|
2156
|
|
|
2156
|
0
|
2944
|
my $stream = shift; |
21
|
2156
|
|
|
|
|
2935
|
my $fh = $stream->{fh}; |
22
|
2156
|
|
|
|
|
2838
|
my $line = $stream->{line}; |
23
|
|
|
|
|
|
|
|
24
|
2156
|
100
|
|
|
|
3917
|
defined $line or return undef; ##no critic (ProhibitExplicitReturnUndef) |
25
|
|
|
|
|
|
|
|
26
|
2080
|
|
|
|
|
3658
|
my (@lines) = ($line); |
27
|
2080
|
|
|
|
|
34705
|
while ( $line = $fh->getline ) { |
28
|
2377
|
|
|
|
|
54948
|
push @lines, $line; |
29
|
2377
|
100
|
|
|
|
11100
|
$line =~ /\S/ or last; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
2080
|
|
|
|
|
34228
|
while ( $line = $fh->getline ) { |
33
|
2228
|
100
|
|
|
|
51266
|
$line =~ /\S/ and last; |
34
|
225
|
|
|
|
|
3589
|
push @lines, $line; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
2080
|
|
|
|
|
5909
|
$stream->{line} = $line; |
38
|
2080
|
|
|
|
|
7391
|
join '', @lines; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|