line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Data::Split::Backend::Hash; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
23157
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
65
|
|
4
|
3
|
|
|
3
|
|
20
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
786
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new |
9
|
|
|
|
|
|
|
{ |
10
|
2
|
|
|
2
|
1
|
2895
|
my $class = shift; |
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
|
|
5
|
my $self = bless {}, $class; |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
|
|
12
|
$self->_init(@_); |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
|
|
2
|
return $self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _hash |
20
|
|
|
|
|
|
|
{ |
21
|
13
|
|
|
13
|
|
20
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
13
|
100
|
|
|
|
25
|
if (@_) |
24
|
|
|
|
|
|
|
{ |
25
|
2
|
|
|
|
|
8
|
$self->{_hash} = shift; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
13
|
|
|
|
|
43
|
return $self->{_hash}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _init |
32
|
|
|
|
|
|
|
{ |
33
|
2
|
|
|
2
|
|
3
|
my ($self, $args) = @_; |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
26
|
$self->_hash(scalar ( $self->get_hash() )); |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
4
|
return; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub list_ids |
41
|
|
|
|
|
|
|
{ |
42
|
4
|
|
|
4
|
1
|
13
|
my ($self) = @_; |
43
|
|
|
|
|
|
|
|
44
|
4
|
|
|
|
|
3
|
my @keys = keys(%{$self->_hash}); |
|
4
|
|
|
|
|
7
|
|
45
|
|
|
|
|
|
|
|
46
|
4
|
|
|
|
|
993
|
require List::MoreUtils; |
47
|
|
|
|
|
|
|
|
48
|
4
|
50
|
|
14
|
|
10079
|
if (List::MoreUtils::notall( sub { /\A[A-Za-z_\-0-9]{1,80}\z/ }, @keys)) |
|
14
|
|
|
|
|
37
|
|
49
|
|
|
|
|
|
|
{ |
50
|
0
|
|
|
|
|
0
|
die "Invalid key in hash reference. All keys must be alphanumeric plus underscores and dashes."; |
51
|
|
|
|
|
|
|
} |
52
|
4
|
|
|
|
|
29
|
return [ sort { $a cmp $b } @keys ]; |
|
14
|
|
|
|
|
33
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub lookup_data |
56
|
|
|
|
|
|
|
{ |
57
|
7
|
|
|
7
|
1
|
7813
|
my ($self, $id) = @_; |
58
|
|
|
|
|
|
|
|
59
|
7
|
|
|
|
|
12
|
return $self->_hash->{$id}; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |