line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: ** Please provide abstract ** |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Form::Processor::Field::Username; |
4
|
|
|
|
|
|
|
$Form::Processor::Field::Username::VERSION = '1.162360'; |
5
|
1
|
|
|
1
|
|
1234
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
7
|
1
|
|
|
1
|
|
3
|
use base 'Form::Processor::Field::Text'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
374
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub validate { |
12
|
2
|
|
|
2
|
1
|
3
|
my $self = shift; |
13
|
|
|
|
|
|
|
|
14
|
2
|
50
|
|
|
|
6
|
return unless $self->SUPER::validate; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
50
|
|
|
5
|
my $input = $self->input || ''; |
17
|
|
|
|
|
|
|
|
18
|
2
|
100
|
|
|
|
8
|
return $self->add_error( 'Usernames must not contain spaces' ) |
19
|
|
|
|
|
|
|
if $input =~ /\s/; |
20
|
|
|
|
|
|
|
|
21
|
1
|
50
|
|
|
|
4
|
return $self->add_error( 'Usernames must be at least 4 characters long' ) |
22
|
|
|
|
|
|
|
if length $input < 4; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
2
|
return 1; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |