| 1 | package DBI::Gofer::Serializer::DataDumper; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 63 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 63 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | our $VERSION = "0.009950"; | ||||||||||||||
| 7 | |||||||||||||||
| 8 | # $Id: DataDumper.pm 9949 2007-09-18 09:38:15Z Tim $ | ||||||||||||||
| 9 | # | ||||||||||||||
| 10 | # Copyright (c) 2007, Tim Bunce, Ireland | ||||||||||||||
| 11 | # | ||||||||||||||
| 12 | # You may distribute under the terms of either the GNU General Public | ||||||||||||||
| 13 | # License or the Artistic License, as specified in the Perl README file. | ||||||||||||||
| 14 | |||||||||||||||
| 15 | =head1 NAME | ||||||||||||||
| 16 | |||||||||||||||
| 17 | DBI::Gofer::Serializer::DataDumper - Gofer serialization using DataDumper | ||||||||||||||
| 18 | |||||||||||||||
| 19 | =head1 SYNOPSIS | ||||||||||||||
| 20 | |||||||||||||||
| 21 | $serializer = DBI::Gofer::Serializer::DataDumper->new(); | ||||||||||||||
| 22 | |||||||||||||||
| 23 | $string = $serializer->serialize( $data ); | ||||||||||||||
| 24 | |||||||||||||||
| 25 | =head1 DESCRIPTION | ||||||||||||||
| 26 | |||||||||||||||
| 27 | Uses DataDumper to serialize. Deserialization is not supported. | ||||||||||||||
| 28 | The output of this class is only meant for human consumption. | ||||||||||||||
| 29 | |||||||||||||||
| 30 | See also L<DBI::Gofer::Serializer::Base>. | ||||||||||||||
| 31 | |||||||||||||||
| 32 | =cut | ||||||||||||||
| 33 | |||||||||||||||
| 34 | 63 | ▶ | use Data::Dumper; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 35 | |||||||||||||||
| 36 | 63 | ▶ | use base qw(DBI::Gofer::Serializer::Base); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 37 | |||||||||||||||
| 38 | |||||||||||||||
| 39 | 0 | ▶ | sub serialize { | ||||||||||||
|
Subroutine
serialize: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||
| 40 | 0 | ▶ | my $self = shift; | ||||||||||||
|
Subroutine
serialize: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||
| 41 | 0 | local $Data::Dumper::Indent = 1; | |||||||||||||
| 42 | 0 | local $Data::Dumper::Terse = 1; | |||||||||||||
| 43 | 0 | local $Data::Dumper::Useqq = 0; # enabling this disables xs | |||||||||||||
| 44 | 0 | local $Data::Dumper::Sortkeys = 1; | |||||||||||||
| 45 | 0 | local $Data::Dumper::Quotekeys = 0; | |||||||||||||
| 46 | 0 | local $Data::Dumper::Deparse = 0; | |||||||||||||
| 47 | 0 | local $Data::Dumper::Purity = 0; | |||||||||||||
| 48 | 0 | my $frozen = Data::Dumper::Dumper(shift); | |||||||||||||
| 49 | 0 | ▶ | return $frozen unless wantarray; | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 50 | 0 | return ($frozen, $self->{deserializer_class}); | |||||||||||||
| 51 | } | ||||||||||||||
| 52 | |||||||||||||||
| 53 | 1; | ||||||||||||||