Data::Encoder - Generic interface for perl encoder or serializer
use Data::Encoder; my $encoder = Data::Encoder->load('JSON'); my $json = $encoder->encode(['foo']); my $data = $encoder->decode($json);
Data::Encoder is generic interface for perl encoder or serializer
This module is inspired Tiffany
THIS MODULE IS IN ITS BETA QUALITY. THE API IS STOLEN FROM TILT BUT MAY CHANGE IN THE FUTURE.
Data::Encoder.pm acts as a factory for Data::Encoder::* classes, which in turn are the actual adapter classes for each encoder.
Load Data::Encoder::* class if necessary, and create new instance of using the given arguments.
my $encoder = Data::Encoder->load('JSON', +{ utf8 => 1, pretty => 1 }); my $encoder = Data::Encoder->load('+My::Encoder', +{ option => 'foo' });
The module SHOULD have a <new> method.
<new
This method creates a new instance of Data::Encoder module.
The module SHOULD have a <encode> method.
<encode
The module SHOULD have a <decod> method.
<decod
xaicron <xaicron {at} cpan.org>
zigorou
tokuhirom
kazuhooku
Copyright 2010 - xaicron
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Data::Encoder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Encoder
CPAN shell
perl -MCPAN -e shell install Data::Encoder
For more information on module installation, please visit the detailed CPAN module installation guide.