line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Validator::Custom::FilterFunction; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
26
|
use strict; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
133
|
|
4
|
5
|
|
|
5
|
|
25
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
133
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
24
|
use Carp 'croak'; |
|
5
|
|
|
|
|
39
|
|
|
5
|
|
|
|
|
1061
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub remove_blank { |
9
|
4
|
|
|
4
|
0
|
5
|
my ($vc, $values, $arg) = @_; |
10
|
|
|
|
|
|
|
|
11
|
4
|
100
|
|
|
|
114
|
croak "\"remove_blank filter value must be array reference" |
12
|
|
|
|
|
|
|
unless ref $values eq 'ARRAY'; |
13
|
|
|
|
|
|
|
|
14
|
3
|
100
|
|
|
|
7
|
$values = [grep { defined $_ && CORE::length $_} @$values]; |
|
7
|
|
|
|
|
29
|
|
15
|
|
|
|
|
|
|
|
16
|
3
|
|
|
|
|
10
|
return $values; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub trim { |
20
|
4
|
|
|
4
|
0
|
8
|
my ($vc, $value, $arg) = @_; |
21
|
|
|
|
|
|
|
|
22
|
4
|
100
|
|
|
|
12
|
return undef unless defined $value; |
23
|
|
|
|
|
|
|
|
24
|
3
|
|
|
|
|
20
|
$value =~ s/^\s*(.*?)\s*$/$1/ms; |
25
|
|
|
|
|
|
|
|
26
|
3
|
|
|
|
|
10
|
return $value; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Validator::Custom::FilterFunction - Filtering functions |