Text-JSON-Nibble
view release on metacpan or search on metacpan
lib/Text/JSON/Nibble.pm view on Meta::CPAN
Version 1.01
=cut
our $VERSION = '1.01';
=head1 WARNING
This module should be used with caution, it will not handle 'badly formed' json well, its entire purpose was because I was experiencing
segfaults with Cpanel::XS's decode_prefix when dealing with a streaming socket buffer.
=head1 DESCRIPTION
This module is a 'character' crawling JSON extractor for plain TEXT, usable in both a 'streaming' or 'block' method, for when you need something that is not XS.
It is particularly handy for when you want to deal with JSON without decoding it.
=head1 SYNOPSIS
use Text::JSON::Nibble;
my $json = '{"lol":{"a":[1,2,3],"b":"lol"}}';
my $item = Text::JSON::Nibble->new();
lib/Text/JSON/Nibble.pm view on Meta::CPAN
bless $self, $class;
return $self;
}
=head1 Block functions
=head2 digest
Digest the text that is fed in and attempt to return a complete an array of JSON object from it, returns either a blank array or an array of text-encoded-json.
Note you can call and use this at any time, even if you are using streaming functionality.
=cut
sub digest {
my $self = shift;
my $data = shift;
# A place for our return
my $return = [];
( run in 0.256 second using v1.01-cache-2.11-cpan-4d50c553e7e )