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