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