line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SHARYANTO::Hash::Util; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
39159
|
use 5.010; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
47
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
6
|
1
|
|
|
1
|
|
2475
|
use Data::Clone; |
|
1
|
|
|
|
|
3758
|
|
|
1
|
|
|
|
|
201
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
10
|
|
|
|
|
|
|
our @EXPORT_OK = qw(rename_key); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.75'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub rename_key { |
15
|
3
|
|
|
3
|
1
|
2190
|
my ($h, $okey, $nkey) = @_; |
16
|
3
|
100
|
|
|
|
24
|
die unless exists $h->{$okey}; |
17
|
2
|
100
|
|
|
|
12
|
die if exists $h->{$nkey}; |
18
|
1
|
|
|
|
|
5
|
$h->{$nkey} = delete $h->{$okey}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
# ABSTRACT: Hash utilities |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
__END__ |