| 1 | package Data::Serializer::Storable; | ||||||||||
| 2 | 12 | ▶ | BEGIN { @Data::Serializer::Storable::ISA = qw(Data::Serializer) } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 12 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 12 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 12 | ▶ | use Storable; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 12 | ▶ | use vars qw($VERSION @ISA); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 12 | $VERSION = '0.03'; | |||||||||
| 10 | |||||||||||
| 11 | |||||||||||
| 12 | # | ||||||||||
| 13 | # Serialize a reference to supplied value | ||||||||||
| 14 | # | ||||||||||
| 15 | 198 | ▶ | sub serialize { | ||||||||
|
Subroutine
serialize: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 16 | 198 | my $self = $_[0]; | |||||||||
| 17 | 198 | my $ret; | |||||||||
| 18 | 198 | $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 | 198 | ▶ | defined($ret) ? $ret : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | # | ||||||||||
| 29 | # Deserialize and de-reference | ||||||||||
| 30 | # | ||||||||||
| 31 | 198 | ▶ | sub deserialize { | ||||||||
|
Subroutine
deserialize: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||
| 32 | 198 | my $ret = Storable::thaw($_[1]); # Does not care whether portable | |||||||||
| 33 | 198 | ▶ | defined($ret) ? $ret : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 12 | 1; | |||||||||
| 37 | __END__ | ||||||||||