line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tie::IxHash::Extension; |
2
|
|
|
|
|
|
|
$Tie::IxHash::Extension::VERSION = '0.001'; |
3
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
90
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
125
|
|
5
|
2
|
|
|
2
|
|
2554
|
use List::AllUtils; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
{ |
8
|
|
|
|
|
|
|
package Tie::IxHash; |
9
|
|
|
|
|
|
|
$Tie::IxHash::VERSION = '0.001'; |
10
|
|
|
|
|
|
|
use constant ERROR_KEY_LENGTH_MISMATCH => "incorrect number of keys"; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub RenameKeys { |
13
|
|
|
|
|
|
|
my ($self, @names) = @_; |
14
|
|
|
|
|
|
|
die ERROR_KEY_LENGTH_MISMATCH if @names != $self->Length; |
15
|
|
|
|
|
|
|
my @values = $self->Values; |
16
|
|
|
|
|
|
|
my @new_kv = List::AllUtils::mesh( @names, @values ); |
17
|
|
|
|
|
|
|
$self->Splice(0, $self->Length, @new_kv); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |