line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pod::Tree::Stream; |
2
|
19
|
|
|
19
|
|
3798708
|
use 5.006; |
|
19
|
|
|
|
|
70
|
|
3
|
19
|
|
|
19
|
|
147
|
use strict; |
|
19
|
|
|
|
|
39
|
|
|
19
|
|
|
|
|
450
|
|
4
|
19
|
|
|
19
|
|
110
|
use warnings; |
|
19
|
|
|
|
|
39
|
|
|
19
|
|
|
|
|
4422
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.31'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
77
|
|
|
77
|
0
|
213
|
my ( $package, $fh ) = @_; |
10
|
|
|
|
|
|
|
|
11
|
77
|
|
|
|
|
295
|
my $stream = { |
12
|
|
|
|
|
|
|
fh => $fh, |
13
|
|
|
|
|
|
|
line => '' |
14
|
|
|
|
|
|
|
}; |
15
|
|
|
|
|
|
|
|
16
|
77
|
|
|
|
|
241
|
bless $stream, $package; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub get_paragraph { |
20
|
2156
|
|
|
2156
|
0
|
2930
|
my $stream = shift; |
21
|
2156
|
|
|
|
|
2924
|
my $fh = $stream->{fh}; |
22
|
2156
|
|
|
|
|
2800
|
my $line = $stream->{line}; |
23
|
|
|
|
|
|
|
|
24
|
2156
|
100
|
|
|
|
3881
|
defined $line or return undef; ##no critic (ProhibitExplicitReturnUndef) |
25
|
|
|
|
|
|
|
|
26
|
2080
|
|
|
|
|
3298
|
my (@lines) = ($line); |
27
|
2080
|
|
|
|
|
34421
|
while ( $line = $fh->getline ) { |
28
|
2377
|
|
|
|
|
54151
|
push @lines, $line; |
29
|
2377
|
100
|
|
|
|
10953
|
$line =~ /\S/ or last; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
2080
|
|
|
|
|
34083
|
while ( $line = $fh->getline ) { |
33
|
2228
|
100
|
|
|
|
50964
|
$line =~ /\S/ and last; |
34
|
225
|
|
|
|
|
3563
|
push @lines, $line; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
2080
|
|
|
|
|
5759
|
$stream->{line} = $line; |
38
|
2080
|
|
|
|
|
7296
|
join '', @lines; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|