line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FormValidator::Simple::Plugin::Trim; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
813986
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use FormValidator::Simple::Constants; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
416
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub TRIM { |
11
|
1
|
|
|
1
|
1
|
6646
|
my ($self, $params, $args) = @_; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
11
|
s/^\s*(.*?)\s*$/$1/ms foreach (@$params); |
14
|
|
|
|
|
|
|
|
15
|
1
|
50
|
|
|
|
6
|
return (TRUE, $#$params ? $params : $params->[0] ); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub TRIM_LEAD { |
19
|
1
|
|
|
1
|
1
|
313
|
my ($self, $params, $args) = @_; |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
3
|
$DB::single = 1; |
22
|
1
|
|
|
|
|
7
|
s/^\s+(.*)$/$1/ms foreach (@$params); |
23
|
|
|
|
|
|
|
|
24
|
1
|
50
|
|
|
|
5
|
return (TRUE, $#$params ? $params : $params->[0] ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub TRIM_TRAIL { |
28
|
0
|
|
|
0
|
1
|
0
|
my ($self, $params, $args) = @_; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
s/^(.*?)\s+$/$1/ms foreach (@$params); |
31
|
|
|
|
|
|
|
|
32
|
0
|
0
|
|
|
|
0
|
return (TRUE, $#$params ? $params : $params->[0] ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub TRIM_COLLAPSE { |
36
|
1
|
|
|
1
|
1
|
452
|
my ($self, $params, $args) = @_; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
3
|
for (@$params) { |
39
|
1
|
|
|
|
|
7
|
s/\s+/ /g; |
40
|
1
|
|
|
|
|
8
|
s/^\s*(.*?)\s*$/$1/ms; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
1
|
50
|
|
|
|
6
|
return (TRUE, $#$params ? $params : $params->[0] ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |