man-pages/man1/json_pp.1.html
2021-03-31 01:06:50 +01:00

227 lines
4.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of JSON_PP</TITLE>
</HEAD><BODY>
<H1>JSON_PP</H1>
Section: Perl Programmers Reference Guide (1)<BR>Updated: 2020-10-19<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
json_pp - JSON::PP command utility
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
json_pp [-v] [-f from_format] [-t to_format] [-json_opt options_to_json1[,options_to_json2[,...]]]
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
json_pp converts between some input and output formats (one of them is <FONT SIZE="-1">JSON</FONT>).
This program was copied from json_xs and modified.
<P>
The default input format is json and the default output format is json with pretty option.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<A NAME="lbAF">&nbsp;</A>
<H3>-f</H3>
<PRE>
-f from_format
</PRE>
<P>
Reads a data in the given format from <FONT SIZE="-1">STDIN.</FONT>
<P>
Format types:
<DL COMPACT>
<DT id="1">json<DD>
as <FONT SIZE="-1">JSON</FONT>
<DT id="2">eval<DD>
as Perl code
</DL>
<A NAME="lbAG">&nbsp;</A>
<H3>-t</H3>
Writes a data in the given format to <FONT SIZE="-1">STDOUT.</FONT>
<DL COMPACT>
<DT id="3">null<DD>
no action.
<DT id="4">json<DD>
as <FONT SIZE="-1">JSON</FONT>
<DT id="5">dumper<DD>
as Data::Dumper
</DL>
<A NAME="lbAH">&nbsp;</A>
<H3>-json_opt</H3>
options to <FONT SIZE="-1">JSON::PP</FONT>
<P>
Acceptable options are:
<P>
<PRE>
ascii latin1 utf8 pretty indent space_before space_after relaxed canonical allow_nonref
allow_singlequote allow_barekey allow_bignum loose escape_slash
</PRE>
<P>
Multiple options must be separated by commas:
<P>
<PRE>
Right: -json_opt pretty,canonical
Wrong: -json_opt pretty -json_opt canonical
</PRE>
<A NAME="lbAI">&nbsp;</A>
<H3>-v</H3>
Verbose option, but currently no action in fact.
<A NAME="lbAJ">&nbsp;</A>
<H3>-V</H3>
Prints version and exits.
<A NAME="lbAK">&nbsp;</A>
<H2>EXAMPLES</H2>
<PRE>
$ perl -e'print q|{&quot;foo&quot;:&quot;あい&quot;,&quot;bar&quot;:1234567890000000000000000}|' |\
json_pp -f json -t dumper -json_opt pretty,utf8,allow_bignum
$VAR1 = {
'bar' =&gt; bless( {
'value' =&gt; [
'0000000',
'0000000',
'5678900',
'1234'
],
'sign' =&gt; '+'
}, 'Math::BigInt' ),
'foo' =&gt; &quot;\x{3042}\x{3044}&quot;
};
$ perl -e'print q|{&quot;foo&quot;:&quot;あい&quot;,&quot;bar&quot;:1234567890000000000000000}|' |\
json_pp -f json -t dumper -json_opt pretty
$VAR1 = {
'bar' =&gt; '1234567890000000000000000',
'foo' =&gt; &quot;\x{e3}\x{81}\x{82}\x{e3}\x{81}\x{84}&quot;
};
</PRE>
<A NAME="lbAL">&nbsp;</A>
<H2>SEE ALSO</H2>
<FONT SIZE="-1">JSON::PP</FONT>, json_xs
<A NAME="lbAM">&nbsp;</A>
<H2>AUTHOR</H2>
Makamaka Hannyaharamitu, &lt;makamaka[at]cpan.org&gt;
<A NAME="lbAN">&nbsp;</A>
<H2>COPYRIGHT AND LICENSE</H2>
Copyright 2010 by Makamaka Hannyaharamitu
<P>
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="9"><A HREF="#lbAE">OPTIONS</A><DD>
<DL>
<DT id="10"><A HREF="#lbAF">-f</A><DD>
<DT id="11"><A HREF="#lbAG">-t</A><DD>
<DT id="12"><A HREF="#lbAH">-json_opt</A><DD>
<DT id="13"><A HREF="#lbAI">-v</A><DD>
<DT id="14"><A HREF="#lbAJ">-V</A><DD>
</DL>
<DT id="15"><A HREF="#lbAK">EXAMPLES</A><DD>
<DT id="16"><A HREF="#lbAL">SEE ALSO</A><DD>
<DT id="17"><A HREF="#lbAM">AUTHOR</A><DD>
<DT id="18"><A HREF="#lbAN">COPYRIGHT AND LICENSE</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:17 GMT, March 31, 2021
</BODY>
</HTML>