| 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
| |||||||||||
| 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
| |||||||||||
| 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; | |||||||||