line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Pipe::List::First; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
53
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
5
|
1
|
|
|
1
|
|
6
|
use List::Util 'first'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
135
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.10'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
6
|
use base 'Text::Pipe::Base'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
196
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
__PACKAGE__->mk_scalar_accessors(qw(code)); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub filter { |
18
|
1
|
|
|
1
|
1
|
3
|
my ($self, $input) = @_; |
19
|
1
|
50
|
|
|
|
5
|
return $input unless ref $input eq 'ARRAY'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# kludge because of prototype requirements |
22
|
1
|
|
|
9
|
|
28
|
first { $self->code->() } @$input; |
|
9
|
|
|
|
|
53
|
|
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |