line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Semantic::Filter; |
2
|
12
|
|
|
12
|
|
76
|
use strict; |
|
12
|
|
|
|
|
27
|
|
|
12
|
|
|
|
|
313
|
|
3
|
12
|
|
|
12
|
|
55
|
use warnings; |
|
12
|
|
|
|
|
20
|
|
|
12
|
|
|
|
|
283
|
|
4
|
12
|
|
|
12
|
|
55
|
use base 'Exporter'; |
|
12
|
|
|
|
|
20
|
|
|
12
|
|
|
|
|
2444
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
7
|
|
|
|
|
|
|
chomp |
8
|
|
|
|
|
|
|
trim |
9
|
|
|
|
|
|
|
sort |
10
|
|
|
|
|
|
|
uniq |
11
|
|
|
|
|
|
|
comma |
12
|
|
|
|
|
|
|
html_line_break |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub chomp { |
16
|
2
|
|
|
2
|
1
|
5
|
chomp; |
17
|
2
|
|
|
|
|
4
|
$_; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub trim { |
21
|
6
|
|
|
6
|
1
|
47
|
s/^ *| *$//g; |
22
|
6
|
|
|
|
|
19
|
$_; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub sort { |
26
|
3
|
|
|
3
|
1
|
31
|
join " ", sort split /\s+/; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub uniq { |
30
|
2
|
|
|
2
|
1
|
4
|
my %h; |
31
|
2
|
100
|
|
|
|
10
|
join " ", map { $h{$_}++ == 0 ? $_ : () } split /\s+/; |
|
7
|
|
|
|
|
27
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub comma { |
35
|
16
|
|
|
16
|
1
|
153
|
1 while s/((?:\A|[^.0-9])[-+]?\d+)(\d{3})/$1,$2/s; |
36
|
16
|
|
|
|
|
34
|
$_; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub html_line_break { |
40
|
1
|
|
|
1
|
1
|
17
|
s!(\r?\n)! $1!g; |
41
|
1
|
|
|
|
|
3
|
\$_; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
__END__ |