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