The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Any::Renderer::Data::Dumper - render data structures through Data::Dumper

SYNOPSIS

  use Any::Renderer;

  my %options = ('DumperOptions' => {'Indent' => 1});
  my $format = "Data::Dumper";
  my $r = new Any::Renderer ( $format, \%options );

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

DESCRIPTION

Any::Renderer::Data::Dumper renders any Perl data structure passed to it into a string representation via Data::Dumper. For example:

  perl -MAny::Renderer -e "print Any::Renderer->new('Data::Dumper')->render({a => 1, b => [2,3]})"

results in:

  $VAR1 = {
            'a' => 1,
            'b' => [
                     2,
                     3
                   ]
          };

FORMATS

Data::Dumper

METHODS

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

$format must be Data::Dumper. See "OPTIONS" for a description of valid %options.

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

The main method.

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

False in this case.

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

Just the one - Data::Dumper.

OPTIONS

VariableName

Name of the perl variable the structure is assigned to. Defaults to $VAR1.

DumperOptions

This hashref of options is mapped to Data::Dumper methods (Indent, Purity, Useqq, etc.). For example:

  perl -MAny::Renderer -e "print Any::Renderer->new('Data::Dumper', {DumperOptions => {Indent=>0}})->render({a => 1, b => [2,3]})"

results in:

  $VAR1 = {'a' => 1,'b' => [2,3]};

See Data::Dumper for the list of Configuration Variables or Methods.

SEE ALSO

Data::Dumper, Any::Renderer

VERSION

$Revision: 1.9 $ on $Date: 2006/08/23 19:41:16 $ by $Author: johna $

AUTHOR

Matt Wilson and 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