line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
BEGIN {
|
2
|
31
|
|
|
31
|
|
296
|
no warnings;
|
|
31
|
|
|
|
|
84
|
|
|
31
|
|
|
|
|
6994
|
|
3
|
31
|
|
|
31
|
|
3954
|
eval 'sub test_prototype (+) { 1 }; test_prototype(1);';
|
4
|
31
|
|
|
|
|
315
|
undef *test_prototype;
|
5
|
31
|
50
|
|
|
|
154
|
if (my $e = $@) {
|
6
|
0
|
0
|
|
|
|
0
|
if ($e =~ /Malformed prototype/) {
|
7
|
0
|
|
|
|
|
0
|
eval 'sub main (;\[@%]) { main_code(@_) }';
|
8
|
0
|
0
|
|
|
|
0
|
die $@ if $@;
|
9
|
|
|
|
|
|
|
} else {
|
10
|
0
|
|
|
|
|
0
|
die $e;
|
11
|
|
|
|
|
|
|
}
|
12
|
|
|
|
|
|
|
} else {
|
13
|
31
|
|
|
0
|
|
2361
|
eval 'sub main (+) { main_code(@_) }';
|
|
0
|
|
|
|
|
|
|
14
|
31
|
50
|
|
|
|
815
|
die $@ if $@;
|
15
|
|
|
|
|
|
|
}
|
16
|
|
|
|
|
|
|
}
|
17
|
|
|
|
|
|
|
|
18
|
31
|
|
|
31
|
|
207
|
use Perlmazing;
|
|
31
|
|
|
|
|
75
|
|
|
31
|
|
|
|
|
187
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub main_code {
|
21
|
0
|
|
|
0
|
|
|
my $list = $_[0];
|
22
|
0
|
0
|
|
|
|
|
if (isa_hash $list) {
|
|
|
0
|
|
|
|
|
|
23
|
0
|
0
|
|
|
|
|
if (void_context()) {
|
24
|
0
|
|
|
|
|
|
my @call = caller(0);
|
25
|
0
|
|
|
|
|
|
warn "Useless call to sort_by_key for a hash in void context (keys won't remain sorted in a hash) at $call[1] line $call[2]\n";
|
26
|
0
|
|
|
|
|
|
return;
|
27
|
|
|
|
|
|
|
}
|
28
|
0
|
|
|
|
|
|
$list = [%$list];
|
29
|
|
|
|
|
|
|
} elsif (not isa_array $list) {
|
30
|
0
|
|
|
|
|
|
return $_[0];
|
31
|
|
|
|
|
|
|
}
|
32
|
0
|
|
|
|
|
|
my @temp;
|
33
|
0
|
|
|
|
|
|
for (my $i = 0; $i < @$list; $i += 2) {
|
34
|
0
|
|
|
|
|
|
push @temp, {key => $list->[$i], value => $list->[$i + 1]};
|
35
|
|
|
|
|
|
|
}
|
36
|
0
|
|
|
|
|
|
@temp = map {$_->{key}, $_->{value}} sort {
|
37
|
0
|
0
|
|
|
|
|
if (lc $a->{key} eq lc $b->{key}) {
|
|
0
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
numeric ($a->{key}, $b->{key});
|
39
|
|
|
|
|
|
|
} else {
|
40
|
0
|
|
|
|
|
|
numeric (lc $a->{key}, lc $b->{key});
|
41
|
|
|
|
|
|
|
}
|
42
|
|
|
|
|
|
|
} @temp;
|
43
|
0
|
0
|
|
|
|
|
if (list_context()) {
|
|
|
0
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
@temp;
|
45
|
|
|
|
|
|
|
} elsif (scalar_context()) {
|
46
|
0
|
|
|
|
|
|
\@temp;
|
47
|
|
|
|
|
|
|
} else {
|
48
|
0
|
|
|
|
|
|
@{$_[0]} = @temp;
|
|
0
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
}
|
50
|
|
|
|
|
|
|
}
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1;
|