line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::Method::CaseInsensitive; |
2
|
1
|
|
|
1
|
|
1275
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
723
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.04; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub permute { |
9
|
286132
|
|
|
286132
|
0
|
395420
|
my($class, $chars, $position) = @_; |
10
|
|
|
|
|
|
|
|
11
|
286132
|
|
|
|
|
667990
|
my $current = join "", @$chars; |
12
|
|
|
|
|
|
|
|
13
|
286132
|
100
|
|
|
|
1970242
|
if($class->can($current)) { |
14
|
9
|
|
|
|
|
244
|
die qq{Acme::Method::CaseInsensitive::method:"$current"} |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
286123
|
100
|
|
|
|
1021775
|
return if $position > @$chars - 1; |
18
|
|
|
|
|
|
|
|
19
|
143072
|
|
|
|
|
1026880
|
my @uc = @$chars; |
20
|
143072
|
|
|
|
|
1080951
|
my @lc = @$chars; |
21
|
|
|
|
|
|
|
|
22
|
143072
|
|
|
|
|
232564
|
$uc[$position] = uc $chars->[$position]; |
23
|
143072
|
|
|
|
|
188238
|
$lc[$position] = lc $chars->[$position]; |
24
|
|
|
|
|
|
|
|
25
|
143072
|
|
|
|
|
300049
|
permute($class, \@uc, $position + 1); |
26
|
143050
|
|
|
|
|
557880
|
permute($class, \@lc, $position + 1); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub UNIVERSAL::AUTOLOAD { |
30
|
10
|
|
|
10
|
|
3087
|
my $class = shift; |
31
|
|
|
|
|
|
|
|
32
|
10
|
|
|
|
|
16
|
my $method_name = $UNIVERSAL::AUTOLOAD; |
33
|
10
|
|
|
|
|
42
|
$method_name =~ s/.*://; |
34
|
10
|
|
|
|
|
48
|
my @chars = split //, $method_name; |
35
|
|
|
|
|
|
|
|
36
|
10
|
|
|
|
|
19
|
eval { permute($class,\@chars,0) }; |
|
10
|
|
|
|
|
24
|
|
37
|
|
|
|
|
|
|
|
38
|
10
|
|
|
|
|
199
|
my($new_name) = $@ =~ m{Acme::Method::CaseInsensitive::method:"([\w\d]+)"}; |
39
|
10
|
50
|
66
|
|
|
34
|
not $new_name and $@ and die $@; |
40
|
|
|
|
|
|
|
|
41
|
10
|
100
|
|
|
|
424
|
return $new_name |
42
|
|
|
|
|
|
|
? $class->$new_name(@_) |
43
|
|
|
|
|
|
|
: croak qq{Can't locate object method "$method_name" via package "$class" (perhaps your forgot to load "$class"?)} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
q; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |