NAME
JSON - A JSON:PP/JSON::XS Factory Class
SYNOPSIS
use JSON;
my $json = JSON->new->utf8->pretty->encode(\%data);
DESCRIPTION
This is purely a fallback factory class that helps keep our code clean.
This is for people with a clean perl 5.14+ install that have JSON::PP but not JSON. Also people that installed JSON::XS on a pre-5.14 system.
my $class = JSON->find_base_class()
On success returns one of: JSON::XS, JSON::PP
Returns undef on failure.
my $obj = JSON->new(<arguments>)
If a base class is found, will return an instantiated object.
This will die() if no base class could be found.
COPYRIGHT
(c) 2014, All rights reserved.
* Abe Timmerman <abeltje@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See:
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.