blib/lib/Defined/KV.pm

filter: Statementstmt 100% 13 / 13 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 95.0% 19 / 20 CC 2 SCAR 3.4
CC
2
Cov
100%
defined_kv
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
↑ Summary
1 package Defined::KV;
2 2 $Defined::KV::VERSION = '0.001';
3 # ABSTRACT: Create a KV pair, but only if the value is defined
4  
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 our @EXPORT = qw(defined_kv);
10  
11 3 ▶sub defined_kv ($$) {
Subroutine defined_kv: called CC=2 SCAR=6.9
Pod undocumented
12 3 ▶ return (defined $_[1] ? @_[0,1] : ());
Branch: 1 branch
BranchTrueFalseTotal
defined $_[1] ? : 2 1 3
13 }
14  
15 2 1;
16  
17 __END__
↑ Summary