line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# (c) Jan Gehring |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Rex::Shared::Var::Hash; |
6
|
|
|
|
|
|
|
|
7
|
20
|
|
|
20
|
|
265
|
use v5.12.5; |
|
20
|
|
|
|
|
63
|
|
8
|
20
|
|
|
20
|
|
100
|
use warnings; |
|
20
|
|
|
|
|
59
|
|
|
20
|
|
|
|
|
786
|
|
9
|
|
|
|
|
|
|
|
10
|
20
|
|
|
20
|
|
196
|
use Rex::Shared::Var::Common qw/__lock __store __retrieve/; |
|
20
|
|
|
|
|
52
|
|
|
20
|
|
|
|
|
12052
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '1.14.2.2'; # TRIAL VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub TIEHASH { |
15
|
43
|
|
|
43
|
|
137
|
my $self = { varname => $_[1], }; |
16
|
43
|
|
|
|
|
176
|
bless $self, $_[0]; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub STORE { |
20
|
45
|
|
|
45
|
|
153
|
my $self = shift; |
21
|
45
|
|
|
|
|
91
|
my $key = shift; |
22
|
45
|
|
|
|
|
84
|
my $value = shift; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
return __lock sub { |
25
|
45
|
|
|
45
|
|
182
|
my $ref = __retrieve; |
26
|
45
|
|
|
|
|
4348
|
my $ret = $ref->{ $self->{varname} }->{$key} = $value; |
27
|
45
|
|
|
|
|
169
|
__store $ref; |
28
|
|
|
|
|
|
|
|
29
|
45
|
|
|
|
|
60563
|
return $ret; |
30
|
45
|
|
|
|
|
439
|
}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub FETCH { |
34
|
164
|
|
|
164
|
|
11228
|
my $self = shift; |
35
|
164
|
|
|
|
|
427
|
my $key = shift; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
return __lock sub { |
38
|
164
|
|
|
164
|
|
618
|
my $ref = __retrieve; |
39
|
164
|
|
|
|
|
19402
|
return $ref->{ $self->{varname} }->{$key}; |
40
|
164
|
|
|
|
|
962
|
}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub DELETE { |
44
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
45
|
0
|
|
|
|
|
0
|
my $key = shift; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__lock sub { |
48
|
0
|
|
|
0
|
|
0
|
my $ref = __retrieve; |
49
|
0
|
|
|
|
|
0
|
delete $ref->{ $self->{varname} }->{$key}; |
50
|
0
|
|
|
|
|
0
|
__store $ref; |
51
|
0
|
|
|
|
|
0
|
}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub CLEAR { |
55
|
16
|
|
|
16
|
|
66
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__lock sub { |
58
|
16
|
|
|
16
|
|
206
|
my $ref = __retrieve; |
59
|
16
|
|
|
|
|
2697
|
$ref->{ $self->{varname} } = {}; |
60
|
16
|
|
|
|
|
112
|
__store $ref; |
61
|
16
|
|
|
|
|
440
|
}; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub EXISTS { |
65
|
129
|
|
|
129
|
|
3498
|
my $self = shift; |
66
|
129
|
|
|
|
|
350
|
my $key = shift; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
return __lock sub { |
69
|
129
|
|
|
129
|
|
527
|
my $ref = __retrieve; |
70
|
129
|
|
|
|
|
16030
|
return exists $ref->{ $self->{varname} }->{$key}; |
71
|
129
|
|
|
|
|
887
|
}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub FIRSTKEY { |
75
|
48
|
|
|
48
|
|
31382
|
my $self = shift; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
return __lock sub { |
78
|
48
|
|
|
48
|
|
255
|
my $ref = __retrieve; |
79
|
48
|
|
|
|
|
7362
|
$self->{__iter__} = $ref->{ $self->{varname} }; |
80
|
|
|
|
|
|
|
|
81
|
48
|
|
|
|
|
209
|
my $temp = keys %{ $self->{__iter__} }; |
|
48
|
|
|
|
|
334
|
|
82
|
48
|
|
|
|
|
150
|
return scalar each %{ $self->{__iter__} }; |
|
48
|
|
|
|
|
410
|
|
83
|
48
|
|
|
|
|
523
|
}; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub NEXTKEY { |
87
|
258
|
|
|
258
|
|
510
|
my $self = shift; |
88
|
258
|
|
|
|
|
344
|
my $prevkey = shift; |
89
|
|
|
|
|
|
|
|
90
|
258
|
|
|
|
|
383
|
return scalar each %{ $self->{__iter__} }; |
|
258
|
|
|
|
|
945
|
|
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |