line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Input::Validator::Constraint::Length; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
28603
|
use strict; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
217
|
|
4
|
6
|
|
|
6
|
|
34
|
use warnings; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
191
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
30
|
use base 'Input::Validator::Constraint'; |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
3056
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub is_valid { |
9
|
32
|
|
|
32
|
1
|
1602
|
my ($self, $value) = @_; |
10
|
|
|
|
|
|
|
|
11
|
32
|
|
|
|
|
50
|
my $len = length $value; |
12
|
|
|
|
|
|
|
|
13
|
32
|
|
|
|
|
124
|
my $args = $self->args; |
14
|
32
|
100
|
|
|
|
98
|
my ($min, $max) = ref $args eq 'ARRAY' ? @{$args} : ($args); |
|
30
|
|
|
|
|
87
|
|
15
|
|
|
|
|
|
|
|
16
|
32
|
100
|
|
|
|
160
|
return $len eq $min ? 1 : 0 unless $max; |
|
|
100
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
28
|
100
|
100
|
|
|
211
|
return $len >= $min && $len <= $max ? 1 : (0, [$min, $max, $len]); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
__END__ |