Kevin McGrath > Any-Renderer > Any::Renderer::Data::Serializer

Download:
Any-Renderer-1.015_02.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 1.005   Source  

NAME ^

Any::Renderer::Data::Serializer - adaptor for Any::Renderer to use any Data::Serializer backends

SYNOPSIS ^

  use Any::Renderer;

  my %options = ();
  my $format = "YAML"; #One of the formats provided by Data::Serializer
  my $r = new Any::Renderer ( $format, \%options );

  my $data_structure = [...]; # arbitrary structure code
  my $string = $r->render ( $data_structure );

DESCRIPTION ^

Any::Renderer::Data::Serializer renders any Perl data structure passed to it into a string representation using modules exposing the Data::Serializer API.

FORMATS ^

All the formats supported by Data::Serializer. Try this to find out what's available on your system:

  perl -MAny::Renderer::Data::Serializer -e "print join(qq{\n}, sort @{Any::Renderer::Data::Serializer::available_formats()})"

METHODS ^

$r = new Any::Renderer::Data::Serializer($format, \%options)

See "FORMATS" for a description of valid values for $format. %options are passed through to the backend module (e.g. to XML::Dumper)

$string = $r->render($data_structure)

The main method.

$bool = Any::Renderer::Data::Serializer::requires_template($format)

This will be false for these formats.

$list_ref = Any::Renderer::Data::Serializer::available_formats()

This will discover the formats supported by your Data::Serializer installation.

ENVIRONMENT ^

Set the ANY_RENDERER_DS_SAFE environment variable to a true value if you want to check each Data::Serializer backend compiles before adding it to the list of available formats. This is safer in that modules with missing dependencies are not advertised as available but it incurs a CPU and memory overhead.

SEE ALSO ^

Data::Serializer, Any::Renderer

VERSION ^

$Revision: 1.5 $ on $Date: 2006/09/04 12:15:54 $ by $Author: johna $

AUTHOR ^

John Alden <cpan _at_ bbc _dot_ co _dot_ uk>

COPYRIGHT ^

(c) BBC 2006. This program is free software; you can redistribute it and/or modify it under the GNU GPL.

See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt

syntax highlighting: