Group
Extension

Matches 4

JSON-XS-VersionOneAndTwo ( L/LB/LBROCARD/JSON-XS-VersionOneAndTwo-0.31.tar.gz, LBROCARD, 2008; MetaCPAN )
JSON-XS-VersionOneAndTwo/lib/JSON/XS/VersionOneAndTwo.pm ( view source; MetaCPAN )
package JSON::XS::VersionOneAndTwo;
use strict;
no strict 'refs';
use warnings;
use JSON::XS;
our $VERSION = '0.31';

sub import {
    my ( $exporter, @imports ) = @_;
    my ( $caller, $file, $line )
 $json_xs_version = $JSON::XS::VERSION;
    if ( $json_xs_version < 2.01 ) {
        *{ $caller . '::encode_json' } = \&JSON::XS::to_json;
        *{ $caller . '::to_json' }     = \&JSON::XS::to_json;
 . '::decode_json' } = \&JSON::XS::from_json;
        *{ $caller . '::from_json' }   = \&JSON::XS::from_json;
    } else {
        *{ $caller . '::encode_json' } = \&JSON::XS::encode_json;
        *{ 
JSON-XS-VersionOneAndTwo ( L/LB/LBROCARD/JSON-XS-VersionOneAndTwo-0.31.tar.gz, LBROCARD, 2008; MetaCPAN )
JSON-XS-VersionOneAndTwo/benchmarks/json_xs_2.pl ( view source; MetaCPAN )
;
use JSON::XS;

my $data = {
    'three' => [ 1, 2, 3 ],
    'four' => { 'a' => 'b' },
    'five' => [ 'a', 'b', 'c' ],
};
my $json = encode_json($data);

cmpthese(
    -1,
    {   'encode_json' => s
ub { encode_json($data) },
        'decode_json' => sub { decode_json($json) },
    }
);
JSON-XS-VersionOneAndTwo ( L/LB/LBROCARD/JSON-XS-VersionOneAndTwo-0.31.tar.gz, LBROCARD, 2008; MetaCPAN )
JSON-XS-VersionOneAndTwo/benchmarks/versiononeandtwo.pl ( view source; MetaCPAN )
rk qw(cmpthese);
use JSON::XS::VersionOneAndTwo;

my $data = {
    'three' => [ 1, 2, 3 ],
    'four' => { 'a' => 'b' },
    'five' => [ 'a', 'b', 'c' ],
};
my $json = encode_json($data);

cmpthese(
 
   -1,
    {   'encode_json' => sub { encode_json($data) },
        'decode_json' => sub { decode_json($json) },
    }
);
JSON-XS-VersionOneAndTwo ( L/LB/LBROCARD/JSON-XS-VersionOneAndTwo-0.31.tar.gz, LBROCARD, 2008; MetaCPAN )
JSON-XS-VersionOneAndTwo/benchmarks/json_xs_1.pl ( view source; MetaCPAN )
JSON::XS;

my $data = {
    'three' => [ 1, 2, 3 ],
    'four' => { 'a' => 'b' },
    'five' => [ 'a', 'b', 'c' ],
};
my $json = to_json($data);

cmpthese(
    -1,
    {   'to_json'   => sub { to_json
($data) },
        'from_json' => sub { from_json($json) },
    }
);

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.