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