line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Pipe::Multiplex; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
86
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.10'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
11
|
use base 'Text::Pipe::Base'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
270
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
__PACKAGE__ |
14
|
|
|
|
|
|
|
->mk_array_accessors(qw(pipes)); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub filter { |
18
|
1
|
|
|
1
|
1
|
3
|
my ($self, $input) = @_; |
19
|
1
|
|
|
|
|
4
|
[ map { $_->filter($input) } $self->pipes ]; |
|
4
|
|
|
|
|
34
|
|
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub deep_count { |
24
|
1
|
|
|
1
|
1
|
12
|
my $self = shift; |
25
|
1
|
|
|
|
|
3
|
my $count = 0; |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
3
|
for my $pipe ($self->pipes) { |
28
|
4
|
100
|
|
|
|
57
|
if ($pipe->can('deep_count')) { |
29
|
1
|
|
|
|
|
5
|
$count += $pipe->deep_count; |
30
|
|
|
|
|
|
|
} else { |
31
|
3
|
|
|
|
|
6
|
$count++; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
7
|
$count; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |