line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package String::Ident; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
665
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
40
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
5
|
1
|
|
|
1
|
|
11
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 0.03; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
627
|
use Text::Unidecode 'unidecode'; |
|
1
|
|
|
|
|
1813
|
|
|
1
|
|
|
|
|
224
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub cleanup { |
12
|
7
|
|
|
7
|
1
|
784
|
my ($self, $text, $maxlength) = @_; |
13
|
|
|
|
|
|
|
|
14
|
7
|
50
|
|
|
|
20
|
$text = '' unless defined($text); |
15
|
7
|
|
|
|
|
15
|
$text = unidecode($text); |
16
|
7
|
|
|
|
|
3847
|
$text =~ s/[^-A-Za-z0-9]/-/g; |
17
|
7
|
|
|
|
|
20
|
$text =~ s/--+/-/g; |
18
|
7
|
|
|
|
|
15
|
$text =~ s/-$//g; |
19
|
7
|
|
|
|
|
10
|
$text =~ s/^-//g; |
20
|
|
|
|
|
|
|
|
21
|
7
|
100
|
100
|
|
|
30
|
if (!$maxlength || $maxlength > 0) { |
22
|
5
|
|
100
|
|
|
18
|
$maxlength ||= 30; |
23
|
5
|
|
|
|
|
9
|
$text = substr($text,0,$maxlength); |
24
|
|
|
|
|
|
|
} |
25
|
7
|
|
|
|
|
16
|
while (length($text) < 4) { |
26
|
4
|
|
|
|
|
38
|
$text .= chr(ord('a') + rand(ord('z') - ord('a') + 1)); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
7
|
|
|
|
|
30
|
return $text; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |