line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Pipe::Stackable; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
4399
|
use warnings; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
244
|
|
4
|
6
|
|
|
6
|
|
33
|
use strict; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
305
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.10'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
6
|
|
33
|
use base 'Text::Pipe::Base'; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
726
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
__PACKAGE__->mk_array_accessors(qw(pipes)); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
{ |
17
|
6
|
|
|
6
|
|
35
|
no warnings 'once'; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
2186
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# aliases to make it more natural |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
*pop = *pipes_pop; |
22
|
|
|
|
|
|
|
*push = *pipes_push; |
23
|
|
|
|
|
|
|
*shift = *pipes_shift; |
24
|
|
|
|
|
|
|
*unshift = *pipes_unshift; |
25
|
|
|
|
|
|
|
*count = *pipes_count; |
26
|
|
|
|
|
|
|
*clear = *pipes_clear; |
27
|
|
|
|
|
|
|
*splice = *pipes_splice; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub new { |
32
|
8
|
|
|
8
|
1
|
77
|
my ($class, @pipes) = @_; |
33
|
8
|
50
|
|
|
|
48
|
my $self = ref $class ? $class : bless {}, $class; |
34
|
8
|
|
|
|
|
41
|
$self->pipes(@pipes); |
35
|
8
|
|
|
|
|
3092
|
$self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub filter { |
40
|
12
|
|
|
12
|
1
|
4227
|
my ($self, $input) = @_; |
41
|
12
|
|
|
|
|
46
|
$input = $_->filter($input) for $self->pipes; |
42
|
12
|
|
|
|
|
79
|
$input; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub deep_count { |
47
|
7
|
|
|
7
|
1
|
1955
|
my $self = shift; |
48
|
7
|
|
|
|
|
67
|
my $count = 0; |
49
|
|
|
|
|
|
|
|
50
|
7
|
|
|
|
|
98
|
for my $pipe ($self->pipes) { |
51
|
16
|
100
|
|
|
|
277
|
if ($pipe->can('deep_count')) { |
52
|
3
|
|
|
|
|
14
|
$count += $pipe->deep_count; |
53
|
|
|
|
|
|
|
} else { |
54
|
13
|
|
|
|
|
30
|
$count++; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
7
|
|
|
|
|
33
|
$count; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |