line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Filter::Cut; |
2
|
2
|
|
|
2
|
|
1210
|
use strict; use utf8; use warnings FATAL => 'all'; |
|
2
|
|
|
2
|
|
4
|
|
|
2
|
|
|
2
|
|
46
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
48
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
70
|
|
3
|
2
|
|
|
2
|
|
9
|
use parent 'DTL::Fast::Filter'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
12
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
$DTL::Fast::FILTER_HANDLERS{'cut'} = __PACKAGE__; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
123
|
use DTL::Fast::Variable; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
317
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#@Override |
11
|
|
|
|
|
|
|
sub parse_parameters |
12
|
|
|
|
|
|
|
{ |
13
|
4
|
|
|
4
|
0
|
7
|
my $self = shift; |
14
|
|
|
|
|
|
|
die $self->get_parse_error("no substitute specified for removing") |
15
|
4
|
50
|
|
|
|
5
|
if not scalar @{$self->{'parameter'}}; |
|
4
|
|
|
|
|
10
|
|
16
|
4
|
|
|
|
|
8
|
$self->{'remove'} = $self->{'parameter'}->[0]; |
17
|
4
|
|
|
|
|
13
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#@Override |
21
|
|
|
|
|
|
|
sub filter |
22
|
|
|
|
|
|
|
{ |
23
|
4
|
|
|
4
|
0
|
6
|
my ($self, $filter_manager, $value, $context) = @_; |
24
|
|
|
|
|
|
|
|
25
|
4
|
|
|
|
|
15
|
my $remove = $self->{'remove'}->render($context); |
26
|
4
|
|
|
|
|
42
|
$value =~ s/\Q$remove\E//gs; |
27
|
|
|
|
|
|
|
|
28
|
4
|
|
|
|
|
16
|
return $value; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |