POE::Filter::JSON::Incr - Parse JSON from streams without needing per-line input
POE::Wheel::Whatever->new( Filter => POE::Filter::JSON::Incr->new( ... ); );
This filter uses the incremental parsing support found in JSON::XS 2.2 and JSON 2.09 to decode JSON data from text streams without needing line by line input.
When true causes POE::Filter::JSON::Incr::Error objects to be created as input on parse errors.
Defaults to false (errors are silently ignored).
Defaults to POE::Filter::JSON::Incr::Error.
The instance of the JSON object.
Note that this is stateful, due to the incremental API's interface.
When no json object is provided, one will be created with these options. Defaults to utf8, relaxed and allow_nonref.
json
utf8
relaxed
allow_nonref
An array reference of deserialized values.
See POE::Filter for the interface.
These methods will parse the text in @chunks. get will return an array reference containing all the parsed values, while get_one will remove one value from the buffer and return it in an array reference.
@chunks
get
get_one
This method serializes the data in @data and returns an array of JSON strings.
@data
Returns the decoded objects in the buffer without clearing it.
This module is maintained using Darcs. You can get the latest version from http://nothingmuch.woobling.org/code, and use darcs send to commit changes.
darcs send
Yuval Kogman <nothingmuch@woobling.org>
Copyright (c) 2008 Yuval Kogman. All rights reserved This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install POE::Filter::JSON::Incr, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Filter::JSON::Incr
CPAN shell
perl -MCPAN -e shell install POE::Filter::JSON::Incr
For more information on module installation, please visit the detailed CPAN module installation guide.