Mojo::JSON::Any - Use JSON::XS when it's available
use Mojo::JSON::Any; my $json = Mojo::JSON::Any->new; my $string = $json->encode({foo => [1, 2], bar => 'hello!'}); my $hash = $json->decode('{"foo": [3, -2, 1]}');
Mojo::JSON::Any is a wrapper over Mojo::JSON and JSON::XS. When the last is available it is used.
Interfaces are identical. Encoding parsing is the same as within Mojo::JSON.
When using JSON::XS is undesirable, even if it is available, set MOJO_JSON environment variable.
MOJO_JSON
See Mojo::JSON.
MOJO::JSON, JSON::XS.
http://github.com/vti/mojo-json-any
Viacheslav Tykhanovskyi, vti@cpan.org.
vti@cpan.org
Copyright (C) 2010, Viacheslav Tykhanovskyi.
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
To install Mojo::JSON::Any, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojo::JSON::Any
CPAN shell
perl -MCPAN -e shell install Mojo::JSON::Any
For more information on module installation, please visit the detailed CPAN module installation guide.