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