line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hash::Util::Exists::Tiny; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
135888
|
use 5.010_001; |
|
2
|
|
|
|
|
16
|
|
4
|
2
|
|
|
2
|
|
18
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
54
|
|
5
|
2
|
|
|
2
|
|
9
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
82
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
12
|
use Exporter 'import'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
655
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @EXPORT_OK = qw(exists_one_of list_exists num_exists |
13
|
|
|
|
|
|
|
defined_one_of list_defined num_defined); |
14
|
|
|
|
|
|
|
our %EXPORT_TAGS = (all => \@EXPORT_OK); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub exists_one_of { |
19
|
7
|
|
|
7
|
1
|
621
|
my $href = shift; |
20
|
7
|
|
|
|
|
50
|
return !!grep(exists($href->{$_}), @_); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub list_exists { |
25
|
6
|
|
|
6
|
1
|
615
|
my $href = shift; |
26
|
6
|
|
|
|
|
43
|
return grep(exists($href->{$_}), @_); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub num_exists { |
31
|
6
|
|
|
6
|
1
|
766
|
my $href = shift; |
32
|
6
|
|
|
|
|
45
|
return scalar grep(exists($href->{$_}), @_); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub defined_one_of { |
37
|
7
|
|
|
7
|
1
|
815
|
my $href = shift; |
38
|
7
|
|
|
|
|
47
|
return !!grep(defined($href->{$_}), @_); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub list_defined { |
43
|
6
|
|
|
6
|
1
|
554
|
my $href = shift; |
44
|
6
|
|
|
|
|
40
|
return grep(defined($href->{$_}), @_); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub num_defined { |
49
|
6
|
|
|
6
|
1
|
812
|
my $href = shift; |
50
|
6
|
|
|
|
|
35
|
return scalar grep(defined($href->{$_}), @_); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |