NAME
Perinci::Result::Format - Format envelope result
VERSION
version 0.11
SYNOPSIS
DESCRIPTION
This module format enveloped result to YAML, JSON, etc. It uses Data::Format::Pretty for the backend. It is used by other Perinci modules like Perinci::CmdLine and Perinci::Access::HTTP::Server.
VARIABLES
%Perinci::Result::Format::Formats
Contains a mapping between format names and Data::Format::Pretty::* module names.
FUNCTIONS
None is currently exported/exportable.
format($res, $format) => STR
FAQ
How to add support for new formats?
First make sure that Data::Format::Pretty::<FORMAT> module is available for your format. Look on CPAN. If it's not, i't also not hard to create one.
Then, add your format to %Perinci::Result::Format::Formats hash:
use Perinci::Result::Format;
# this means format named 'xml' will be handled by Data::Format::Pretty::XML
$Perinci::Result::Format::Formats{xml} = 'XML';
SEE ALSO
AUTHOR
Steven Haryanto <stevenharyanto@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.