=head1 NAME JSON::XS - JSON serialising/deserialising, done correctly and fast =head1 SYNOPSIS use JSON::XS; =head1 DESCRIPTION =over 4 =cut package JSON::XS; BEGIN { $VERSION = '0.1'; @ISA = qw(Exporter); require Exporter; require XSLoader; XSLoader::load JSON::XS::, $VERSION; } =item =cut use JSON::DWIW; use Benchmark; use utf8; #my $json = '{"ü":1,"a":[1,{"3":4},2],"b":5,"üü":2}'; my $json = '{"test":9555555555555555555,"hu" : -1e+5, "arr" : [ 1,2,3,4,5]}'; my $js = JSON::XS->new; warn $js->indent (0); warn $js->canonical (0); warn $js->ascii (0); warn $js->space_after (0); use Data::Dumper; warn Dumper $js->decode ($json); warn Dumper $js->encode ($js->decode ($json)); #my $x = {"üü" => 2, "ü" => 1, "a" => [1,{3,4},2], b => 5}; #my $js2 = JSON::DWIW->new; # #timethese 200000, { # a => sub { $js->encode ($x) }, # b => sub { $js2->to_json ($x) }, #}; 1; =back =head1 AUTHOR Marc Lehmann http://home.schmorp.de/ =cut