Test::Smoke::Util::LoadAJSON - A JSON:PP/JSON::XS Factory Class
use Test::Smoke::Util::LoadAJSON; my $json = Test::Smoke::Util::LoadAJSON->new->utf8->pretty->encode(\%data);
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.
On success returns one of: JSON::XS, JSON::PP
Returns undef on failure.
If a base class is found, will return an instantiated object.
This will die() if no base class could be found.
(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:
http://www.perl.com/perl/misc/Artistic.html
http://www.gnu.org/copyleft/gpl.html
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.
To install Test::Smoke, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Smoke
CPAN shell
perl -MCPAN -e shell install Test::Smoke
For more information on module installation, please visit the detailed CPAN module installation guide.