App::PipeFilter::JsonPath - return JSON::Path-specified fields from a JSON stream
version 0.005
Here is the jsonpath(1) pipeline filter.
#!/usr/bin/perl use App::PipeFilter::JsonPath; exit App::PipeFilter::JsonPath->new_with_options()->run();
App::PipeFilter::JsonPath implements the jsonpath(1) pipeline filter. It's modeled after the UNIX cut(1) utility, but output fields are specified by JSON::Path expressions.
This class subclasses App::PipeFilter::Generic::Json.
The o() attribute specifies one or more fields to extract from input and write to output. Members are JSON::Path expressions. All other fields will be discarded. MooseX::Getopt sets o() to the values of the -o options from the command line.
The transform() method iterates over its input and returns new records composed of only the fields described by the JSON::Path expressions in o().
You may read this module's implementation in its entirety at
perldoc -m App::PipeFilter::JsonPath
App::PipeFilter::JsonCut is a similar, faster, and simpler implementation that works best with flat JSON objects. jcut(1) should be used whenever possible.
App::PipeFilter has top-level documentation including a table of contents for all the libraries and utilities included in the project.
https://rt.cpan.org/Public/Dist/Display.html?Name=App-PipeFilter
https://github.com/rcaputo/app-pipefilter
App::PipeFilter::JsonPath is Copyright 2011 by Rocco Caputo. All rights are reserved. App::PipeFilter::JsonPath is released under the same terms as Perl itself.
To install App::PipeFilter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::PipeFilter
CPAN shell
perl -MCPAN -e shell install App::PipeFilter
For more information on module installation, please visit the detailed CPAN module installation guide.