Serializer/Storable.pm

filter: Statementstmt 100% 21 / 21 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 94.1% 32 / 34 CC 3 SCAR 3.8
CC
3
Cov
92%
deserialize
2.1
serialize
2.0
BEGIN
1.0
CRAP 1.5
« Serializer/Data/Denter.pm ↑ Summary Serializer/XML/Simple.pm »
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
BranchTrueFalseTotal
defined $ret ? : 198 0 198
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
BranchTrueFalseTotal
defined $ret ? : 198 0 198
34 }
35  
36 12 1;
37 __END__
« Serializer/Data/Denter.pm ↑ Summary Serializer/XML/Simple.pm »