| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "JSON_PP 1" |
| 58 |
.TH JSON_PP 1 2026-04-10 "perl v5.40.1" "Perl Programmers Reference Guide" |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
json_pp \- JSON::PP command utility |
| 65 |
.SH SYNOPSIS |
| 66 |
.IX Header "SYNOPSIS" |
| 67 |
.Vb 1 |
| 68 |
\& json_pp [\-v] [\-f from_format] [\-t to_format] [\-json_opt options_to_json1[,options_to_json2[,...]]] |
| 69 |
.Ve |
| 70 |
.SH DESCRIPTION |
| 71 |
.IX Header "DESCRIPTION" |
| 72 |
json_pp converts between some input and output formats (one of them is JSON). |
| 73 |
This program was copied from json_xs and modified. |
| 74 |
.PP |
| 75 |
The default input format is json and the default output format is json with pretty option. |
| 76 |
.SH OPTIONS |
| 77 |
.IX Header "OPTIONS" |
| 78 |
.SS \-f |
| 79 |
.IX Subsection "-f" |
| 80 |
.Vb 1 |
| 81 |
\& \-f from_format |
| 82 |
.Ve |
| 83 |
.PP |
| 84 |
Reads a data in the given format from STDIN. |
| 85 |
.PP |
| 86 |
Format types: |
| 87 |
.IP json 4 |
| 88 |
.IX Item "json" |
| 89 |
as JSON |
| 90 |
.IP eval 4 |
| 91 |
.IX Item "eval" |
| 92 |
as Perl code |
| 93 |
.SS \-t |
| 94 |
.IX Subsection "-t" |
| 95 |
Writes a data in the given format to STDOUT. |
| 96 |
.IP null 4 |
| 97 |
.IX Item "null" |
| 98 |
no action. |
| 99 |
.IP json 4 |
| 100 |
.IX Item "json" |
| 101 |
as JSON |
| 102 |
.IP dumper 4 |
| 103 |
.IX Item "dumper" |
| 104 |
as Data::Dumper |
| 105 |
.SS \-json_opt |
| 106 |
.IX Subsection "-json_opt" |
| 107 |
options to JSON::PP |
| 108 |
.PP |
| 109 |
Acceptable options are: |
| 110 |
.PP |
| 111 |
.Vb 2 |
| 112 |
\& ascii latin1 utf8 pretty indent space_before space_after relaxed canonical allow_nonref |
| 113 |
\& allow_singlequote allow_barekey allow_bignum loose escape_slash indent_length |
| 114 |
.Ve |
| 115 |
.PP |
| 116 |
Multiple options must be separated by commas: |
| 117 |
.PP |
| 118 |
.Vb 1 |
| 119 |
\& Right: \-json_opt pretty,canonical |
| 120 |
\& |
| 121 |
\& Wrong: \-json_opt pretty \-json_opt canonical |
| 122 |
.Ve |
| 123 |
.SS \-v |
| 124 |
.IX Subsection "-v" |
| 125 |
Verbose option, but currently no action in fact. |
| 126 |
.SS \-V |
| 127 |
.IX Subsection "-V" |
| 128 |
Prints version and exits. |
| 129 |
.SH EXAMPLES |
| 130 |
.IX Header "EXAMPLES" |
| 131 |
.Vb 2 |
| 132 |
\& $ perl \-e\*(Aqprint q|{"foo":"あい","bar":1234567890000000000000000}|\*(Aq |\e |
| 133 |
\& json_pp \-f json \-t dumper \-json_opt pretty,utf8,allow_bignum |
| 134 |
\& |
| 135 |
\& $VAR1 = { |
| 136 |
\& \*(Aqbar\*(Aq => bless( { |
| 137 |
\& \*(Aqvalue\*(Aq => [ |
| 138 |
\& \*(Aq0000000\*(Aq, |
| 139 |
\& \*(Aq0000000\*(Aq, |
| 140 |
\& \*(Aq5678900\*(Aq, |
| 141 |
\& \*(Aq1234\*(Aq |
| 142 |
\& ], |
| 143 |
\& \*(Aqsign\*(Aq => \*(Aq+\*(Aq |
| 144 |
\& }, \*(AqMath::BigInt\*(Aq ), |
| 145 |
\& \*(Aqfoo\*(Aq => "\ex{3042}\ex{3044}" |
| 146 |
\& }; |
| 147 |
\& |
| 148 |
\& $ perl \-e\*(Aqprint q|{"foo":"あい","bar":1234567890000000000000000}|\*(Aq |\e |
| 149 |
\& json_pp \-f json \-t dumper \-json_opt pretty |
| 150 |
\& |
| 151 |
\& $VAR1 = { |
| 152 |
\& \*(Aqbar\*(Aq => \*(Aq1234567890000000000000000\*(Aq, |
| 153 |
\& \*(Aqfoo\*(Aq => "\ex{e3}\ex{81}\ex{82}\ex{e3}\ex{81}\ex{84}" |
| 154 |
\& }; |
| 155 |
.Ve |
| 156 |
.SH "SEE ALSO" |
| 157 |
.IX Header "SEE ALSO" |
| 158 |
JSON::PP, json_xs |
| 159 |
.SH AUTHOR |
| 160 |
.IX Header "AUTHOR" |
| 161 |
Makamaka Hannyaharamitu, <makamaka[at]cpan.org> |
| 162 |
.SH "COPYRIGHT AND LICENSE" |
| 163 |
.IX Header "COPYRIGHT AND LICENSE" |
| 164 |
Copyright 2010 by Makamaka Hannyaharamitu |
| 165 |
.PP |
| 166 |
This library is free software; you can redistribute it and/or modify |
| 167 |
it under the same terms as Perl itself. |