| 1 | package Template::Semantic::Filter; | ||||||||||
| 2 | 12 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 12 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 12 | ▶ | use base 'Exporter'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 12 | our @EXPORT_OK = qw( | |||||||||
| 7 | chomp | ||||||||||
| 8 | trim | ||||||||||
| 9 | sort | ||||||||||
| 10 | uniq | ||||||||||
| 11 | comma | ||||||||||
| 12 | html_line_break | ||||||||||
| 13 | ); | ||||||||||
| 14 | |||||||||||
| 15 | 2 | ▶ | sub chomp { | ||||||||
|
Subroutine
chomp: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 16 | 2 | chomp; | |||||||||
| 17 | 2 | $_; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 6 | ▶ | sub trim { | ||||||||
|
Subroutine
trim: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 21 | 6 | s/^ *| *$//g; | |||||||||
| 22 | 6 | $_; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 3 | ▶ | sub sort { | ||||||||
|
Subroutine
sort: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 26 | 3 | join " ", sort split /\s+/; | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 2 | ▶ | sub uniq { | ||||||||
|
Subroutine
uniq: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 30 | 2 | my %h; | |||||||||
| 31 | 2 | ▶ | join " ", map { $h{$_}++ == 0 ? $_ : () } split /\s+/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 16 | ▶ | sub comma { | ||||||||
|
Subroutine
comma: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 35 | 16 | ▶ | 1 while s/((?:\A|[^.0-9])[-+]?\d+)(\d{3})/$1,$2/s; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 16 | $_; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 1 | ▶ | sub html_line_break { | ||||||||
|
Subroutine
html_line_break: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 40 | 1 | s!(\r?\n)!<br />$1!g; | |||||||||
| 41 | 1 | \$_; | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 12 | 1; | |||||||||
| 45 | __END__ | ||||||||||