line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::dategrep::Iterator::Fh; |
2
|
8
|
|
|
8
|
|
3015
|
use strict; |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
182
|
|
3
|
8
|
|
|
8
|
|
23
|
use warnings; |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
162
|
|
4
|
8
|
|
|
8
|
|
43
|
use Moo; |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
30
|
|
5
|
8
|
|
|
8
|
|
1332
|
use FileHandle; |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
38
|
|
6
|
|
|
|
|
|
|
extends 'App::dategrep::Iterator'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has fh => ( is => 'ro', required => 1 ); |
9
|
|
|
|
|
|
|
has end_passed => ( is => 'rw', default => sub { 0 } ); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub get_entry_unbuffered { |
12
|
25
|
|
|
25
|
0
|
25
|
my $self = shift; |
13
|
|
|
|
|
|
|
|
14
|
25
|
50
|
33
|
|
|
404
|
return if $self->end_passed || $self->fh->eof; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
LINE: |
17
|
25
|
|
|
|
|
1186
|
while ( my $entry = $self->getline() ) { |
18
|
|
|
|
|
|
|
|
19
|
36
|
100
|
|
|
|
1226
|
if ( $self->multiline ) { |
20
|
4
|
|
66
|
|
|
13
|
while (!$self->fh->eof |
|
|
|
33
|
|
|
|
|
21
|
|
|
|
|
|
|
&& !$self->end_passed |
22
|
|
|
|
|
|
|
&& !$self->next_line_has_date ) |
23
|
|
|
|
|
|
|
{ |
24
|
9
|
|
|
|
|
32
|
$entry .= $self->getline(); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
36
|
|
|
|
|
96
|
my ( $epoch, $error ) = $self->to_epoch( $entry ); |
28
|
36
|
50
|
|
|
|
7269
|
if ( !$epoch ) { |
29
|
0
|
0
|
|
|
|
0
|
next LINE if $self->skip_unparsable; |
30
|
0
|
|
|
|
|
0
|
die "Unparsable line: $entry\n"; |
31
|
|
|
|
|
|
|
} |
32
|
36
|
100
|
|
|
|
138
|
if ( $epoch >= $self->end ) { |
33
|
7
|
|
|
|
|
22
|
$self->end_passed(1); |
34
|
7
|
|
|
|
|
82
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
29
|
100
|
|
|
|
98
|
next LINE if $epoch < $self->start; |
38
|
|
|
|
|
|
|
|
39
|
18
|
|
|
|
|
84
|
return $entry; |
40
|
|
|
|
|
|
|
} |
41
|
0
|
|
|
|
|
|
return; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |