line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package capitalization; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
28738
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
72
|
|
4
|
2
|
|
|
2
|
|
10
|
use vars qw($VERSION); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
112
|
|
5
|
|
|
|
|
|
|
$VERSION = 0.03; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
20
|
use Devel::Symdump; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
472
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my %done; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub unimport { |
12
|
1
|
|
|
1
|
|
7
|
my($class, @mods) = @_; |
13
|
1
|
|
|
|
|
2
|
for my $mod (@mods) { |
14
|
1
|
50
|
|
|
|
4
|
next if $done{$mod}; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
3
|
my $file = mod2file($mod); |
17
|
1
|
50
|
|
|
|
294
|
require $file unless $INC{$file}; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
213
|
my $dump = Devel::Symdump->new($mod); |
20
|
1
|
|
|
|
|
56
|
for my $meth (map { s/^\Q$mod\E:://; $_ } $dump->functions) { |
|
6
|
|
|
|
|
25
|
|
|
6
|
|
|
|
|
10
|
|
21
|
6
|
|
|
|
|
18
|
my $new = nocap($meth); |
22
|
6
|
100
|
|
|
|
14
|
if ($new ne $meth) { |
23
|
2
|
|
|
2
|
|
11
|
no strict 'refs'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
511
|
|
24
|
5
|
|
|
|
|
5
|
*{"$mod\::$new"} = \&{"$mod\::$meth"}; |
|
5
|
|
|
|
|
23
|
|
|
5
|
|
|
|
|
8
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
1
|
|
|
|
|
1549
|
$done{$mod} = 1; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub nocap { |
32
|
6
|
|
|
6
|
0
|
7
|
my $method = shift; |
33
|
6
|
|
|
|
|
17
|
$method =~ s/(?<=[a-z])([A-Z]+)/"_" . lc($1)/eg; |
|
4
|
|
|
|
|
11
|
|
34
|
6
|
|
|
|
|
8
|
$method =~ tr/A-Z/a-z/; |
35
|
6
|
|
|
|
|
9
|
return $method; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub mod2file { |
39
|
1
|
|
|
1
|
0
|
1
|
my $mod = shift; |
40
|
1
|
|
|
|
|
4
|
$mod =~ s!::!/!g; |
41
|
1
|
|
|
|
|
2
|
return "$mod.pm"; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
__END__ |