| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Tie::Redis::Scalar; |
|
2
|
|
|
|
|
|
|
{ |
|
3
|
|
|
|
|
|
|
$Tie::Redis::Scalar::VERSION = '0.26'; |
|
4
|
|
|
|
|
|
|
} |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# Consider using overload instead of this maybe, could then implement things |
|
7
|
|
|
|
|
|
|
# like ++ in terms of Redis commands. |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub TIESCALAR { |
|
10
|
0
|
|
|
0
|
|
|
my($class, %args) = @_; |
|
11
|
0
|
|
|
|
|
|
bless \%args, $class; |
|
12
|
|
|
|
|
|
|
} |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _cmd { |
|
15
|
0
|
|
|
0
|
|
|
my($self, $cmd, @args) = @_; |
|
16
|
0
|
|
|
|
|
|
return $self->{redis}->_cmd($cmd, $self->{key}, @args); |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub FETCH { |
|
20
|
0
|
|
|
0
|
|
|
my($self) = @_; |
|
21
|
0
|
|
|
|
|
|
$self->_cmd("get"); |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub STORE { |
|
25
|
0
|
|
|
0
|
|
|
my($self, $value) = @_; |
|
26
|
0
|
|
|
|
|
|
$self->_cmd("set", $value); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |