line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::Types::MooseLike::Email; |
2
|
5
|
|
|
5
|
|
93497
|
use strict; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
207
|
|
3
|
5
|
|
|
5
|
|
31
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
258
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
4639
|
use MooX::Types::MooseLike qw/exception_message/; |
|
5
|
|
|
|
|
17005
|
|
|
5
|
|
|
|
|
498
|
|
7
|
5
|
|
|
5
|
|
5416
|
use MooX::Types::MooseLike::Base; |
|
5
|
|
|
|
|
24668
|
|
|
5
|
|
|
|
|
288
|
|
8
|
5
|
|
|
5
|
|
17120
|
use Email::Valid; |
|
5
|
|
|
|
|
1316281
|
|
|
5
|
|
|
|
|
272
|
|
9
|
5
|
|
|
5
|
|
8269
|
use Email::Valid::Loose; |
|
5
|
|
|
|
|
10303
|
|
|
5
|
|
|
|
|
189
|
|
10
|
5
|
|
|
5
|
|
7573
|
use Email::Abstract; |
|
5
|
|
|
|
|
524670
|
|
|
5
|
|
|
|
|
251
|
|
11
|
5
|
|
|
5
|
|
67
|
use Exporter qw/import/; |
|
5
|
|
|
|
|
17
|
|
|
5
|
|
|
|
|
1907
|
|
12
|
|
|
|
|
|
|
our @EXPORT_OK = (); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $type_definitions = [ |
15
|
|
|
|
|
|
|
{ |
16
|
|
|
|
|
|
|
name => 'EmailAddress', |
17
|
|
|
|
|
|
|
subtype_of => 'Str', |
18
|
|
|
|
|
|
|
from => 'MooX::Types::MooseLike::Base', |
19
|
|
|
|
|
|
|
test => sub { Email::Valid->address($_[0]) }, |
20
|
|
|
|
|
|
|
message => sub { return exception_message( $_[0], 'a valid e-mail address' ) }, |
21
|
|
|
|
|
|
|
}, |
22
|
|
|
|
|
|
|
{ |
23
|
|
|
|
|
|
|
name => 'EmailAddressLoose', |
24
|
|
|
|
|
|
|
subtype_of => 'Str', |
25
|
|
|
|
|
|
|
from => 'MooX::Types::MooseLike::Base', |
26
|
|
|
|
|
|
|
test => sub { Email::Valid::Loose->address($_[0]) }, |
27
|
|
|
|
|
|
|
message => sub { return exception_message( $_[0], 'a valid e-mail address' ) }, |
28
|
|
|
|
|
|
|
}, |
29
|
|
|
|
|
|
|
{ |
30
|
|
|
|
|
|
|
name => 'EmailMessage', |
31
|
|
|
|
|
|
|
subtype_of => 'Object', |
32
|
|
|
|
|
|
|
from => 'MooX::Types::MooseLike::Base', |
33
|
|
|
|
|
|
|
test => sub { Email::Abstract->new($_[0]) }, |
34
|
|
|
|
|
|
|
message => sub { return exception_message( $_[0], 'recognized by Email::Abstract' ) }, |
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
]; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
MooX::Types::MooseLike::register_types($type_definitions, __PACKAGE__, 'MooseX::Types::Email::Loose'); |
39
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( all => \@EXPORT_OK ); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |