blib/lib/Lemonldap/NG/Common/EmailAddress.pm

filter: Statementstmt 82.6% 19 / 23 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 75.0% 24 / 32 CC 3 SCAR 10.6
CC
3
Cov
74%
BEGIN
4.8
BEGIN
1.0
BEGIN
1.0
CRAP 2.9
« blib/lib/Lemonldap/NG/Common/FormEncode.pm ↑ Summary blib/lib/Lemonldap/NG/Common/UserAgent.pm »
1 package Lemonldap::NG::Common::EmailAddress;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our @ISA = qw(Exporter);
7 1 our $VERSION = '2.0.0';
8  
9 1 our @EXPORT_OK = qw(format_email);
10 1 our @EXPORT = qw(format_email);
11  
12 1 my $module;
13  
14 1 ▶BEGIN {
Subroutine BEGIN: called CC=3 SCAR=15.7
15 1 eval {
16 1 require Email::Address::XS;
17 1 $module = 'Email::Address::XS';
18 };
19 1 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 1 1
20 0 eval {
21 0 require Email::Address;
22 0 $module = 'Email::Address';
23 };
24 0 ▶ die "Unable to find Email::Address, neither Email::Address::XS: $@"
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 0 0
25 if ($@);
26 }
27 }
28  
29 1 ▶sub format_email {
Subroutine format_email: called CC=1 SCAR=0.0
Pod undocumented
30 1 my ( $name, $email ) = @_;
31 1 my $obj = $module->new( $name, $email );
32 1 return $obj->as_string;
33 }
34  
35 1 1;
« blib/lib/Lemonldap/NG/Common/FormEncode.pm ↑ Summary blib/lib/Lemonldap/NG/Common/UserAgent.pm »