The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mojo::JSON::Any - Use JSON::XS when it's available

SYNOPSIS

    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]}');

DESCRIPTION

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.

ATTRIBUTES

See Mojo::JSON.

METHODS

See Mojo::JSON.

SEE ALSO

MOJO::JSON, JSON::XS.

DEVELOPMENT

Repository

    http://github.com/vti/mojo-json-any

AUTHOR

Viacheslav Tykhanovskyi, vti@cpan.org.

COPYRIGHT AND LICENSE

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.