line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Packager::ListUtil; |
2
|
5
|
|
|
5
|
|
37
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
241
|
|
3
|
|
|
|
|
|
|
require Exporter; |
4
|
5
|
|
|
5
|
|
26
|
use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS); |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
1779
|
|
5
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
%EXPORT_TAGS = ( all => [qw(any all none uniq)], ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub any (&@) { ## no critic |
12
|
8
|
|
|
8
|
0
|
15
|
my $f = shift; |
13
|
8
|
50
|
|
|
|
21
|
return if !@_; |
14
|
8
|
|
|
|
|
18
|
for (@_) { |
15
|
20
|
100
|
|
|
|
62
|
return 1 if $f->(); |
16
|
|
|
|
|
|
|
} |
17
|
7
|
|
|
|
|
24
|
return 0; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub all (&@) { ## no critic |
21
|
0
|
|
|
0
|
0
|
|
my $f = shift; |
22
|
0
|
0
|
|
|
|
|
return if !@_; |
23
|
0
|
|
|
|
|
|
for (@_) { |
24
|
0
|
0
|
|
|
|
|
return 0 if !$f->(); |
25
|
|
|
|
|
|
|
} |
26
|
0
|
|
|
|
|
|
return 1; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub none (&@) { ## no critic |
30
|
0
|
|
|
0
|
0
|
|
my $f = shift; |
31
|
0
|
0
|
|
|
|
|
return if !@_; |
32
|
0
|
|
|
|
|
|
for (@_) { |
33
|
0
|
0
|
|
|
|
|
return 0 if $f->(); |
34
|
|
|
|
|
|
|
} |
35
|
0
|
|
|
|
|
|
return 1; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub uniq (@) { ## no critic |
39
|
0
|
|
|
0
|
0
|
|
my %h; |
40
|
0
|
0
|
|
|
|
|
map { $h{$_}++ == 0 ? $_ : () } @_; |
|
0
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
__END__ |