File Coverage

blib/lib/POE/Component/IKC/Freezer.pm
Criterion Covered Total %
statement 22 23 95.6
branch n/a
condition n/a
subroutine 7 8 87.5
pod 0 4 0.0
total 29 35 82.8


line stmt bran cond sub pod time code
1             package POE::Component::IKC::Freezer;
2              
3             ############################################################
4             # $Id: Freezer.pm 1247 2014-07-07 09:06:34Z fil $
5             # Copyright 2001-2014 Philip Gwyn. All rights reserved.
6             # This program is free software; you can redistribute it and/or modify
7             # it under the same terms as Perl itself.
8              
9 2     2   25601 use strict;
  2         5  
  2         84  
10 2     2   1665 use Data::Dumper;
  2         12112  
  2         184  
11              
12 2     2   15 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
  2         4  
  2         172  
13 2     2   13 use Carp;
  2         2  
  2         563  
14              
15             require Exporter;
16             @ISA = qw(Exporter);
17             @EXPORT_OK = qw(freeze thaw dclone);
18             $VERSION = '0.2402';
19              
20 0     0 0 0 sub DEBUG { 0 }
21              
22              
23             ############################################################
24             sub freeze
25             {
26 4     4 0 730 my($data)=@_;
27 4         7 local $Data::Dumper::Purity = 1;
28 4         9 local $Data::Dumper::Indent = 0;
29 4         6 local $Data::Dumper::Varname = __PACKAGE__."::VAR";
30 4         15 return Dumper $data;
31             }
32              
33             ############################################################
34             sub thaw
35             {
36 4     4 0 648 my($string)=@_;
37 4         5 local $POE::Component::IKC::Freezer::VAR1;
38 4         450 eval $string;
39 4         18 return $POE::Component::IKC::Freezer::VAR1;
40             }
41              
42             ############################################################
43 3     3 0 3575 sub dclone { thaw(freeze($_[0])); }
44              
45              
46             1;
47             __END__