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


Any-Renderer documentation  | view source Contained in the Any-Renderer distribution.

Index


NAME

Top

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

SYNOPSIS

Top

  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

Top

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

Top

Data::Dumper

METHODS

Top

$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

Top

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

Top

Data::Dumper, Any::Renderer

VERSION

Top

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

AUTHOR

Top

Matt Wilson and John Alden <cpan _at_ bbc _dot_ co _dot_ uk>

COPYRIGHT

Top


Any-Renderer documentation  | view source Contained in the Any-Renderer distribution.