8 $JSON::PP58::VERSION = '1.03';
13 unless ( defined &utf8::is_utf8 ) {
15 *utf8::is_utf8 = *Encode::is_utf8;
18 *JSON::PP::JSON_PP_encode_ascii = \&JSON::PP::_encode_ascii;
19 *JSON::PP::JSON_PP_encode_latin1 = \&JSON::PP::_encode_latin1;
20 *JSON::PP::JSON_PP_decode_surrogates = \&JSON::PP::_decode_surrogates;
21 *JSON::PP::JSON_PP_decode_unicode = \&JSON::PP::_decode_unicode;
23 if ($] >= 5.008 and $] < 5.008003) { # join() in 5.8.0 - 5.8.2 is broken.
29 return '' if (@_ < 2);
32 for (@_) { $str .= $j . $_; }
41 sub JSON::PP::incr_parse {
42 local $Carp::CarpLevel = 1;
43 ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_parse( @_ );
47 sub JSON::PP::incr_text : lvalue {
48 $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new;
50 if ( $_[0]->{_incr_parser}->{incr_parsing} ) {
51 Carp::croak("incr_text can not be called when the incremental parser already started parsing");
53 $_[0]->{_incr_parser}->{incr_text};
57 sub JSON::PP::incr_skip {
58 ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_skip;
62 sub JSON::PP::incr_reset {
63 ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_reset;
74 JSON::PP58 - Helper module in using JSON::PP in Perl 5.8 and lator
78 JSON::PP calls internally.
82 Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>
85 =head1 COPYRIGHT AND LICENSE
87 Copyright 2008-2009 by Makamaka Hannyaharamitu
89 This library is free software; you can redistribute it and/or modify
90 it under the same terms as Perl itself.