GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Template::Plugin::YAML(3) User Contributed Perl Documentation Template::Plugin::YAML(3)

Template::Plugin::YAML - Plugin interface to YAML

    [% USE YAML %]

    [% YAML.dump(variable) %]
    [% YAML.dump_html(variable) %]
    [% value = YAML.undump(yaml_string) %]
    [% YAML.dumpfile(filename, variable) %]
    [% value = YAML.undumpfile(filename) %]

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

    [% USE YAML %]

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

    [% USE yaml %]

These are the methods supported by the YAML object.

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

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

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

    [% USE yaml %]
    [% yaml.dump_html(myvar) %]

Converts a YAML-encoded string into the equivalent data structure. Here's a way to deep-copy a complex structure by completely serializing the data.

  [% USE yaml;
     yaml_string = yaml.dump(complex_data_structure);
     complex_copy = yaml.undump(yaml_string);
  %]

Converts the data to YAML encoding, and dumps it to the specified filepath.

  [% USE yaml; yaml.dumpfile(".storage", my_data) %]

Loads the YAML-encoded data from the specified filepath

  [% USE yaml; my_data = yaml.undumpfile(".storage") %]

Richard Clamp <richardc@unixbeard.net>, with undump, undumpfile, and dumpfile implementation by Randal L. Schwartz <merlyn@stonehenge.com>

based on Simon Matthews' Template::Plugin::Dumper

Copyright 2003, 2008 Richard Clamp All Rights Reserved.

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

Template::Plugin::Dumper
2008-12-15 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.