line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#======================================================================== |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Badger::Codec::Storable |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# DESCRIPTION |
6
|
|
|
|
|
|
|
# Codec for encoding/decoding data via the Storable module. |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# AUTHOR |
9
|
|
|
|
|
|
|
# Andy Wardley |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
#======================================================================== |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Badger::Codec::Storable; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Badger::Class |
16
|
4
|
|
|
|
|
29
|
version => 0.01, |
17
|
4
|
|
|
4
|
|
4908
|
base => 'Badger::Codec'; |
|
4
|
|
|
|
|
8
|
|
18
|
|
|
|
|
|
|
|
19
|
4
|
|
|
4
|
|
2737
|
use Storable qw( freeze thaw ); |
|
4
|
|
|
|
|
12981
|
|
|
4
|
|
|
|
|
600
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub encode { |
22
|
12
|
|
|
12
|
1
|
38
|
my $self = shift; |
23
|
12
|
|
|
|
|
32
|
freeze(@_); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub decode { |
27
|
12
|
|
|
12
|
1
|
58
|
my $self = shift; |
28
|
12
|
|
|
|
|
33
|
thaw(@_); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# shortcuts straight to the real encoder/decoder subs for efficient aliasing |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub encoder { |
34
|
4
|
|
|
4
|
1
|
8
|
\&freeze; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub decoder { |
38
|
4
|
|
|
4
|
1
|
6
|
\&thaw; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |