blib/lib/App/Asciio/setup/import_export/asciioe.pl untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 42 CC 2 SCAR 11.5
CC
2
Cov
0%
export_asciioe
6.0
import_asciioe
2.0
BEGIN
2.0
CRAP 3.1
1  
2 use strict ;
3 use warnings ;
4 use File::Slurp ;
5  
6 #----------------------------------------------------------------------------------------------------------------------------
7  
8 register_import_export_handlers
9 (
10 asciioe =>
11 {
12 IMPORT => \&import_asciioe,
13 EXPORT => \&export_asciioe,
14 },
15 ) ;
16  
17 #----------------------------------------------------------------------------------------------------------------------------
18  
19 sub import_asciioe
20 {
21 my ($self, $file) = @_ ;
22  
23 my $self_to_resurect= do $file or die "import_asciioe: can't load file '$file': $! $@\n" ;
24 return($self_to_resurect, $file) ;
25 }
26  
27 #----------------------------------------------------------------------------------------------------------------------------
28  
29 sub export_asciioe
30 {
31 my ($self, $elements_to_save, $file, $data) = @_ ;
32  
33 if($self->{CREATE_BACKUP} && -e $file)
34 {
35 use File::Copy;
36 copy($file,"$file.bak") or die "export_pod: Copy failed while making backup copy: $!" ;
37 }
38  
39 my $saved = write_file($file, {binmode => ':utf8'}, $self->serialize_self(1) .'$VAR1 ;') ;
40  
41 return $saved ;
42 }
43  
44