App::PipeFilter::JsonMap - map input fields to output fields by renaming them
#!/usr/bin/perl use App::PipeFilter::JsonMap; exit App::PipeFilter::JsonMap->new_with_options()->run();
App::PipeFilter::JsonMap implements the jmap(1) pipeline filter. It renames JSON object fields by mapping input field names to new ones on output.
This class subclasses App::PipeFilter::Generic::Json.
The i() attribute holds an arrayref of one or more input fields to be renamed. All other input fields will be present in the resulting output without being renamed. MooseX::Getopt sets i() to the values of the -i options from the command line.
The o() attribute holds an arrayref of the new names of the fields from i(). Both i() and o() must have the same number of field names. MooseX::Getopt sets o() to the values of the -o options from the command line.
The transform() method renames the fields named in the i() attribute to the names found in the o() attribute.
You may read this module's implementation in its entirety at
perldoc -m App::PipeFilter::JsonMap
App::PipeFilter has top-level documentation including a table of contents for all the libraries and utilities included in the project.
App::PipeFilter::JsonMap is Copyright 2011 by Rocco Caputo. All rights are reserved. App::PipeFilter::JsonMap is released under the same terms as Perl itself.