line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package String::Similex; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
BEGIN { |
4
|
1
|
|
|
1
|
|
13105
|
require 5.006; |
5
|
|
|
|
|
|
|
} |
6
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
7
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require Exporter; |
10
|
1
|
|
|
1
|
|
10
|
use vars qw(@ISA @EXPORT $VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
155
|
|
11
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
@EXPORT = qw(&similex $similex_nocode); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
$VERSION = '0.01'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $similex_nocode = undef; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub similex { |
19
|
0
|
|
|
0
|
0
|
|
my (@str,$char,$previous,$code) = @_; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
foreach (@str) { |
22
|
0
|
|
|
|
|
|
$_ = lc($_); |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
if ($_ eq '') { |
25
|
0
|
|
|
|
|
|
$_ = $similex_nocode; |
26
|
|
|
|
|
|
|
} else { |
27
|
0
|
|
|
|
|
|
tr/hcfjkrwxyz2689a41|liou0mn\-_t7s5\$e3bdgqpuv/0111111111111122333344455667788899AABBBCC/; |
28
|
0
|
|
|
|
|
|
tr///cs; |
29
|
0
|
|
|
|
|
|
tr/0//d; |
30
|
0
|
|
|
|
|
|
tr/0-9ABC//cd; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
wantarray ? @str : shift @str; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |