… | |
… | |
40 | Beginning with version 2.0 of the JSON module, when both JSON and |
40 | Beginning with version 2.0 of the JSON module, when both JSON and |
41 | JSON::XS are installed, then JSON will fall back on JSON::XS (this can be |
41 | JSON::XS are installed, then JSON will fall back on JSON::XS (this can be |
42 | overridden) with no overhead due to emulation (by inheriting constructor |
42 | overridden) with no overhead due to emulation (by inheriting constructor |
43 | and methods). If JSON::XS is not available, it will fall back to the |
43 | and methods). If JSON::XS is not available, it will fall back to the |
44 | compatible JSON::PP module as backend, so using JSON instead of JSON::XS |
44 | compatible JSON::PP module as backend, so using JSON instead of JSON::XS |
45 | gives you a portable JSON API that can be fast when you need and doesn't |
45 | gives you a portable JSON API that can be fast when you need it and |
46 | require a C compiler when that is a problem. |
46 | doesn't require a C compiler when that is a problem. |
47 | |
47 | |
48 | As this is the n-th-something JSON module on CPAN, what was the reason |
48 | As this is the n-th-something JSON module on CPAN, what was the reason |
49 | to write yet another JSON module? While it seems there are many JSON |
49 | to write yet another JSON module? While it seems there are many JSON |
50 | modules, none of them correctly handle all corner cases, and in most cases |
50 | modules, none of them correctly handle all corner cases, and in most cases |
51 | their maintainers are unresponsive, gone missing, or not listening to bug |
51 | their maintainers are unresponsive, gone missing, or not listening to bug |
… | |
… | |
101 | |
101 | |
102 | package JSON::XS; |
102 | package JSON::XS; |
103 | |
103 | |
104 | use common::sense; |
104 | use common::sense; |
105 | |
105 | |
106 | our $VERSION = 3.03; |
106 | our $VERSION = 3.04; |
107 | our @ISA = qw(Exporter); |
107 | our @ISA = qw(Exporter); |
108 | |
108 | |
109 | our @EXPORT = qw(encode_json decode_json); |
109 | our @EXPORT = qw(encode_json decode_json); |
110 | |
110 | |
111 | use Exporter; |
111 | use Exporter; |
… | |
… | |
1696 | ->allow_nonref(0) >> even if this is the current default, if they cannot |
1696 | ->allow_nonref(0) >> even if this is the current default, if they cannot |
1697 | handle non-reference values, in preparation for the day when the default |
1697 | handle non-reference values, in preparation for the day when the default |
1698 | will change. |
1698 | will change. |
1699 | |
1699 | |
1700 | |
1700 | |
1701 | =head1 THREADS |
1701 | =head1 (I-)THREADS |
1702 | |
1702 | |
1703 | This module is I<not> guaranteed to be thread safe and there are no |
1703 | This module is I<not> guaranteed to be ithread (or MULTIPLICITY-) safe |
1704 | plans to change this until Perl gets thread support (as opposed to the |
1704 | and there are no plans to change this. Note that perl's builtin so-called |
1705 | horribly slow so-called "threads" which are simply slow and bloated |
1705 | theeads/ithreads are officially deprecated and should not be used. |
1706 | process simulations - use fork, it's I<much> faster, cheaper, better). |
|
|
1707 | |
|
|
1708 | (It might actually work, but you have been warned). |
|
|
1709 | |
1706 | |
1710 | |
1707 | |
1711 | =head1 THE PERILS OF SETLOCALE |
1708 | =head1 THE PERILS OF SETLOCALE |
1712 | |
1709 | |
1713 | Sometimes people avoid the Perl locale support and directly call the |
1710 | Sometimes people avoid the Perl locale support and directly call the |