File Coverage

blib/lib/Acme/Dump/And/Dumper.pm
Criterion Covered Total %
statement 28 28 100.0
branch 4 6 66.6
condition n/a
subroutine 8 8 100.0
pod 1 1 100.0
total 41 43 95.3


line stmt bran cond sub pod time code
1             package Acme::Dump::And::Dumper;
2              
3 1     1   24058 use strict;
  1         3  
  1         37  
4 1     1   5 use warnings;
  1         2  
  1         107  
5              
6             our $VERSION = '1.001004'; # VERSION
7              
8             require Exporter;
9             our @ISA = qw/Exporter Data::Dumper/;
10             our @EXPORT_OK = @Data::Dumper::EXPORT_OK;
11             our @EXPORT = ( 'DnD', @Data::Dumper::EXPORT );
12              
13 1     1   1080 use Data::Rmap;
  1         1537  
  1         192  
14 1     1   8 use Scalar::Util qw/blessed/;
  1         2  
  1         52  
15 1     1   1112 use Data::Dumper ( @Data::Dumper::EXPORT, @Data::Dumper::EXPORT_OK, );
  1         13085  
  1         143  
16 1     1   3506 use Storable qw/dclone/;
  1         13028  
  1         418  
17             $Storable::Deparse = 1;
18              
19             sub DnD {
20 1     1 1 244 my @in = @_;
21              
22 1         2 my @out;
23 1         3 for my $data ( @in ) {
24 1         3 my $working_data = eval { dclone $data };
  1         165  
25 1 50       5 $working_data = $data
26             unless defined $working_data;
27              
28             rmap_all {
29 3 100   3   230 defined blessed $_ and $_ = 'obj[' . ref($_) . ']'
30 1         13 } $working_data;
31              
32 1         61 push @out, Dumper $working_data;
33             }
34              
35 1 50       148 return wantarray ? @out : join '', @out;
36             }
37              
38             1;
39              
40             __END__