line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hash::Util::Exists::Tiny;
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
149114
|
use 5.010_001;
|
|
2
|
|
|
|
|
18
|
|
4
|
2
|
|
|
2
|
|
20
|
use strict;
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
58
|
|
5
|
2
|
|
|
2
|
|
11
|
use warnings FATAL => 'all';
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
109
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
13
|
use Exporter 'import';
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
674
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.05';
|
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
|
697
|
my $href = shift;
|
20
|
7
|
|
|
|
|
48
|
return !!grep(exists($href->{$_}), @_);
|
21
|
|
|
|
|
|
|
}
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub list_exists {
|
25
|
6
|
|
|
6
|
1
|
578
|
my $href = shift;
|
26
|
6
|
|
|
|
|
45
|
return grep(exists($href->{$_}), @_);
|
27
|
|
|
|
|
|
|
}
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub num_exists {
|
31
|
6
|
|
|
6
|
1
|
826
|
my $href = shift;
|
32
|
6
|
|
|
|
|
35
|
return scalar grep(exists($href->{$_}), @_);
|
33
|
|
|
|
|
|
|
}
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub defined_one_of {
|
37
|
7
|
|
|
7
|
1
|
892
|
my $href = shift;
|
38
|
7
|
|
|
|
|
83
|
return !!grep(defined($href->{$_}), @_);
|
39
|
|
|
|
|
|
|
}
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub list_defined {
|
43
|
6
|
|
|
6
|
1
|
557
|
my $href = shift;
|
44
|
6
|
|
|
|
|
50
|
return grep(defined($href->{$_}), @_);
|
45
|
|
|
|
|
|
|
}
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub num_defined {
|
49
|
6
|
|
|
6
|
1
|
816
|
my $href = shift;
|
50
|
6
|
|
|
|
|
46
|
return scalar grep(defined($href->{$_}), @_);
|
51
|
|
|
|
|
|
|
}
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1;
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__
|