line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Filter::Length; |
2
|
3
|
|
|
3
|
|
1075
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
68
|
|
3
|
3
|
|
|
3
|
|
21
|
use utf8; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
15
|
|
4
|
3
|
|
|
3
|
|
60
|
use warnings FATAL => 'all'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
81
|
|
5
|
3
|
|
|
3
|
|
15
|
use parent 'DTL::Fast::Filter'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
14
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$DTL::Fast::FILTER_HANDLERS{length} = __PACKAGE__; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#@Override |
10
|
|
|
|
|
|
|
sub filter |
11
|
|
|
|
|
|
|
{ |
12
|
6
|
|
|
6
|
0
|
9
|
shift; # self |
13
|
6
|
|
|
|
|
9
|
shift; # filter_manager |
14
|
6
|
|
|
|
|
9
|
my $value = shift; # value |
15
|
6
|
|
|
|
|
10
|
shift; # context |
16
|
|
|
|
|
|
|
|
17
|
6
|
100
|
|
|
|
13
|
if (ref $value eq 'ARRAY') |
18
|
|
|
|
|
|
|
{ |
19
|
3
|
|
|
|
|
6
|
$value = scalar @$value; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
else |
22
|
|
|
|
|
|
|
{ |
23
|
3
|
|
50
|
|
|
10
|
$value = length( $value // '' ); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
6
|
|
|
|
|
14
|
return $value; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |