line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Serializer::Storable; |
2
|
11
|
|
|
11
|
|
593
|
BEGIN { @Data::Serializer::Storable::ISA = qw(Data::Serializer) } |
3
|
|
|
|
|
|
|
|
4
|
11
|
|
|
11
|
|
113
|
use warnings; |
|
11
|
|
|
|
|
29
|
|
|
11
|
|
|
|
|
397
|
|
5
|
11
|
|
|
11
|
|
64
|
use strict; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
263
|
|
6
|
11
|
|
|
11
|
|
68
|
use Storable; |
|
11
|
|
|
|
|
133
|
|
|
11
|
|
|
|
|
765
|
|
7
|
11
|
|
|
11
|
|
88
|
use vars qw($VERSION @ISA); |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
1928
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.03'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# Serialize a reference to supplied value |
14
|
|
|
|
|
|
|
# |
15
|
|
|
|
|
|
|
sub serialize { |
16
|
189
|
|
|
189
|
1
|
404
|
my $self = $_[0]; |
17
|
189
|
|
|
|
|
292
|
my $ret; |
18
|
189
|
|
|
|
|
657
|
$ret = Storable::nfreeze($_[1]); |
19
|
|
|
|
|
|
|
#using network byte order makes sense to always do, under all circumstances to make it platform neutral |
20
|
|
|
|
|
|
|
#if ($self->{portable}) { |
21
|
|
|
|
|
|
|
# $ret = Storable::nfreeze($_[1]); |
22
|
|
|
|
|
|
|
#} else { |
23
|
|
|
|
|
|
|
# $ret = Storable::freeze($_[1]); |
24
|
|
|
|
|
|
|
#} |
25
|
189
|
50
|
|
|
|
10161
|
defined($ret) ? $ret : undef; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# |
29
|
|
|
|
|
|
|
# Deserialize and de-reference |
30
|
|
|
|
|
|
|
# |
31
|
|
|
|
|
|
|
sub deserialize { |
32
|
189
|
|
|
189
|
1
|
727
|
my $ret = Storable::thaw($_[1]); # Does not care whether portable |
33
|
189
|
50
|
|
|
|
5227
|
defined($ret) ? $ret : undef; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
# |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Data::Serializer::Storable - Creates bridge between Data::Serializer and Storable |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use Data::Serializer::Storable; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Module is used internally to Data::Serializer |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=over 4 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=item B<serialize> - Wrapper to normalize serializer method name |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=item B<deserialize> - Wrapper to normalize deserializer method name |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=back |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 AUTHOR |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Neil Neely <neil@neely.cx> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Copyright 2001 by Neil Neely. All rights reserved. |
68
|
|
|
|
|
|
|
This program is free software; you can redistribute it |
69
|
|
|
|
|
|
|
and/or modify it under the same terms as Perl itself. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SEE ALSO |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
perl(1), Data::Serializer(3), Data::Dumper(3). |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|