line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Format::Validate::Email; |
2
|
|
|
|
|
|
|
our $VERSION = q/0.2/; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
158509
|
use Carp; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
97
|
|
5
|
2
|
|
|
2
|
|
12
|
use base q/Exporter/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
573
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our @EXPORT_OK = qw/ |
8
|
|
|
|
|
|
|
looks_like_any_email |
9
|
|
|
|
|
|
|
looks_like_common_email |
10
|
|
|
|
|
|
|
/; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
13
|
|
|
|
|
|
|
q/all/ => [qw/ |
14
|
|
|
|
|
|
|
looks_like_any_email |
15
|
|
|
|
|
|
|
looks_like_common_email |
16
|
|
|
|
|
|
|
/] |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub looks_like_any_email { |
20
|
|
|
|
|
|
|
|
21
|
5
|
|
33
|
5
|
0
|
124
|
$_ = shift || croak q/Value most be provided/; |
22
|
5
|
|
|
|
|
36
|
/^\S+@\S+$/ |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub looks_like_common_email { |
26
|
|
|
|
|
|
|
|
27
|
15
|
|
33
|
15
|
0
|
128
|
$_ = shift || croak q/Value most be provided/; |
28
|
15
|
|
|
|
|
116
|
/^\w+(?:\.\w+)*@(?:[A-Z0-9-]+\.)+[A-Z]{2,6}$/i |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=pod |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=encoding utf8 |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Data::Format::Validate::Email - A e-mail validating module. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SYNOPSIS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Module that validate e-mail addressess. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 Utilities |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=over 4 |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=item Any E-mail |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
use Data::Format::Validate::Email 'looks_like_any_email'; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
looks_like_any_email 'israel.batista@univem.edu.br'; # 1 |
53
|
|
|
|
|
|
|
looks_like_any_email '!$%@&[.B471374@*")..$$#!+=.-'; # 1 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
looks_like_any_email 'israel.batistaunivem.edu.br'; # 0 |
56
|
|
|
|
|
|
|
looks_like_any_email 'israel. batista@univem.edu.br'; # 0 |
57
|
|
|
|
|
|
|
looks_like_any_email 'israel.batista@univ em.edu.br'; # 0 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item Common E-mail |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
use Data::Format::Validate::Email 'looks_like_common_email'; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
looks_like_common_email 'israel.batista@univem.edu.br'; # 1 |
64
|
|
|
|
|
|
|
looks_like_common_email 'israel.batista42@univem.edu.br'; # 1 |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
looks_like_common_email 'israel.@univem.edu.br'; # 0 |
67
|
|
|
|
|
|
|
looks_like_common_email 'israel.batistaunivem.edu.br'; # 0 |
68
|
|
|
|
|
|
|
looks_like_common_email '!$%@&[.B471374@*")..$$#!+=.-'; # 0 |
69
|
|
|
|
|
|
|
looks_like_common_email '!srael.batista@un!vem.edu.br'; # 0 |
70
|
|
|
|
|
|
|
looks_like_common_email 'i%rael.bati%ta@univem.edu.br'; # 0 |
71
|
|
|
|
|
|
|
looks_like_common_email 'isra&l.batista@univ&m.&du.br'; # 0 |
72
|
|
|
|
|
|
|
looks_like_common_email 'israel[batista]@univem.edu.br'; # 0 |
73
|
|
|
|
|
|
|
looks_like_common_email 'israel. batista@univem.edu.br'; # 0 |
74
|
|
|
|
|
|
|
looks_like_common_email 'israel.batista@univem. edu.br'; # 0 |
75
|
|
|
|
|
|
|
looks_like_common_email 'israel.batista@univem..edu.br'; # 0 |
76
|
|
|
|
|
|
|
looks_like_common_email 'israel..batista@univem.edu.br'; # 0 |
77
|
|
|
|
|
|
|
looks_like_common_email 'israel.batista@@univem.edu.br'; # 0 |
78
|
|
|
|
|
|
|
looks_like_common_email 'israel.batista@univem.edu.brasilia'; # 0 |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=back |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 CONTRIBUITION |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This source is on Github: |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
https://github.com/rozcovo/Data-Format-Validate/blob/master/lib/Data/Format/Validate/Email.pm |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 AUTHOR |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Created by Israel Batista <> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |