blib/lib/Hash/Util/Exists/Tiny.pm

filter: Statementstmt 100% 27 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 6 / 6 totaltotal 100% 43 / 43 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 package Hash::Util::Exists::Tiny;
2  
3 2 ▶use 5.010_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 our $VERSION = '0.07';
10  
11  
12 2 our @EXPORT_OK = qw(exists_one_of list_exists num_exists
13 defined_one_of list_defined num_defined);
14 2 our %EXPORT_TAGS = (all => \@EXPORT_OK);
15  
16  
17  
18 sub exists_one_of {
19 7 ▶ my $href = shift;
Subroutine exists_one_of: called CC=1 SCAR=0.0
Pod documented
20 7 return !!grep(exists($href->{$_}), @_);
21 }
22  
23  
24 sub list_exists {
25 6 ▶ my $href = shift;
Subroutine list_exists: called CC=1 SCAR=0.0
Pod documented
26 6 return grep(exists($href->{$_}), @_);
27 }
28  
29  
30 sub num_exists {
31 6 ▶ my $href = shift;
Subroutine num_exists: called CC=1 SCAR=0.0
Pod documented
32 6 return scalar grep(exists($href->{$_}), @_);
33 }
34  
35  
36 sub defined_one_of {
37 7 ▶ my $href = shift;
Subroutine defined_one_of: called CC=1 SCAR=0.0
Pod documented
38 7 return !!grep(defined($href->{$_}), @_);
39 }
40  
41  
42 sub list_defined {
43 6 ▶ my $href = shift;
Subroutine list_defined: called CC=1 SCAR=0.0
Pod documented
44 6 return grep(defined($href->{$_}), @_);
45 }
46  
47  
48 sub num_defined {
49 6 ▶ my $href = shift;
Subroutine num_defined: called CC=1 SCAR=0.0
Pod documented
50 6 return scalar grep(defined($href->{$_}), @_);
51 }
52  
53  
54  
55 2 1;
56  
57 __END__
↑ Summary