line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widget::Constraint::Email; |
2
|
|
|
|
|
|
|
|
3
|
88
|
|
|
88
|
|
82020
|
use warnings; |
|
88
|
|
|
|
|
228
|
|
|
88
|
|
|
|
|
2660
|
|
4
|
88
|
|
|
88
|
|
498
|
use strict; |
|
88
|
|
|
|
|
200
|
|
|
88
|
|
|
|
|
2723
|
|
5
|
88
|
|
|
88
|
|
469
|
use base 'HTML::Widget::Constraint'; |
|
88
|
|
|
|
|
185
|
|
|
88
|
|
|
|
|
7303
|
|
6
|
88
|
|
|
88
|
|
98399
|
use Email::Valid; |
|
88
|
|
|
|
|
16238198
|
|
|
88
|
|
|
|
|
1417
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
HTML::Widget::Constraint::Email - Email Constraint |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $c = $widget->constraint( 'Email', 'foo' ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Email Constraint. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 METHODS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head2 validate |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=cut |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub validate { |
27
|
6
|
|
|
6
|
1
|
9
|
my ( $self, $value ) = @_; |
28
|
6
|
50
|
|
|
|
12
|
return 1 unless $value; |
29
|
6
|
100
|
|
|
|
30
|
return 0 unless Email::Valid->address( -address => $value ); |
30
|
3
|
|
|
|
|
2521
|
return 1; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 AUTHOR |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Sebastian Riedel, C |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 LICENSE |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
40
|
|
|
|
|
|
|
the same terms as Perl itself. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |