[%# # IMPORTANT NOTE # This documentation is generated automatically from source # templates. Any changes you make here may be lost. # # The 'docsrc' documentation source bundle is available for download # from http://www.template-toolkit.org/docs.html and contains all # the source templates, XML files, scripts, etc., from which the # documentation for the Template Toolkit is built. -%] [% META book = 'Modules' page = 'Plugin_Dumper' %] [% WRAPPER toc; PROCESS tocitem title ="SYNOPSIS" subs = []; PROCESS tocitem title ="DESCRIPTION" subs = []; PROCESS tocitem title ="METHODS" subs = [ "dump()", "dump_html()" ]; PROCESS tocitem title ="AUTHOR" subs = []; PROCESS tocitem title ="VERSION" subs = []; PROCESS tocitem title ="COPYRIGHT" subs = []; PROCESS tocitem title ="SEE ALSO" subs = []; END %] [% WRAPPER section title="SYNOPSIS" -%]

        [% tt_start_tag %] USE Dumper [% tt_end_tag %]

        [% tt_start_tag %] Dumper.dump(variable) [% tt_end_tag %]
        [% tt_start_tag %] Dumper.dump_html(variable) [% tt_end_tag %]

[%- END %] [% WRAPPER section title="DESCRIPTION" -%]

This is a very simple Template Toolkit Plugin Interface to the Data::Dumper module. A Dumper object will be instantiated via the following directive:

        [% tt_start_tag %] USE Dumper [% tt_end_tag %]

As a standard plugin, you can also specify its name in lower case:

        [% tt_start_tag %] USE dumper [% tt_end_tag %]

The Data::Dumper 'Pad', 'Indent' and 'Varname' options are supported as constructor arguments to affect the output generated. See [% ttlink('Data::Dumper') -%] for further details.

        [% tt_start_tag %] USE dumper(Indent=0, Pad="<br>") [% tt_end_tag %]

These options can also be specified in lower case.

        [% tt_start_tag %] USE dumper(indent=0, pad="<br>") [% tt_end_tag %]

[%- END %] [% WRAPPER section title="METHODS" -%]

There are two methods supported by the Dumper object. Each will output into the template the contents of the variables passed to the object method.

[% WRAPPER subsection title = "dump()" -%]

Generates a raw text dump of the data structure(s) passed

        [% tt_start_tag %] USE Dumper [% tt_end_tag %]
        [% tt_start_tag %] Dumper.dump(myvar) [% tt_end_tag %]
        [% tt_start_tag %] Dumper.dump(myvar, yourvar) [% tt_end_tag %]

[%- END %] [% WRAPPER subsection title = "dump_html()" -%]

Generates a dump of the data structures, as per dump(), but with the characters <, > and & converted to their equivalent HTML entities and newlines converted to <br>.

        [% tt_start_tag %] USE Dumper [% tt_end_tag %]
        [% tt_start_tag %] Dumper.dump_html(myvar) [% tt_end_tag %]

[%- END %] [%- END %] [% WRAPPER section title="AUTHOR" -%]

Simon Matthews <sam@knowledgepool.com>

[%- END %] [% WRAPPER section title="VERSION" -%]

2.65, distributed as part of the Template Toolkit version 2.14, released on 04 October 2004.

[%- END %] [% WRAPPER section title="COPYRIGHT" -%]

Copyright (C) 2000 Simon Matthews All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

[%- END %] [% WRAPPER section title="SEE ALSO" -%]

[% ttlink('Template::Plugin', 'Template::Plugin') -%], [% ttlink('Data::Dumper', 'Data::Dumper') -%]

[%- END %]