1JSON_PP(1) User Contributed Perl Documentation JSON_PP(1)
2
3
4
6 json_pp - JSON::PP command utility
7
9 json_pp [-v] [-f from_format] [-t to_format] [-json_opt options_to_json]
10
12 json_pp converts between some input and output formats (one of them is
13 JSON). This program was copied from json_xs and modified.
14
15 The default input format is json and the default output format is json
16 with pretty option.
17
19 -f
20 -f from_format
21
22 Reads a data in the given format from STDIN.
23
24 Format types:
25
26 json
27 as JSON
28
29 eval
30 as Perl code
31
32 -t
33 Writes a data in the given format to STDOUT.
34
35 null
36 no action.
37
38 json
39 as JSON
40
41 dumper
42 as Data::Dumper
43
44 -json_opt
45 options to JSON::PP
46
47 Acceptable options are:
48
49 ascii latin1 utf8 pretty indent space_before space_after relaxed canonical allow_nonref
50 allow_singlequote allow_barekey allow_bignum loose escape_slash
51
52 -v
53 Verbose option, but currently no action in fact.
54
55 -V
56 Prints version and exits.
57
59 $ perl -e'print q|{"foo":"XX","bar":1234567890000000000000000}|' |\
60 json_pp -f json -t dumper -json_opt pretty,utf8,allow_bignum
61
62 $VAR1 = {
63 'bar' => bless( {
64 'value' => [
65 '0000000',
66 '0000000',
67 '5678900',
68 '1234'
69 ],
70 'sign' => '+'
71 }, 'Math::BigInt' ),
72 'foo' => "\x{3042}\x{3044}"
73 };
74
75 $ perl -e'print q|{"foo":"XX","bar":1234567890000000000000000}|' |\
76 json_pp -f json -t dumper -json_opt pretty
77
78 $VAR1 = {
79 'bar' => '1234567890000000000000000',
80 'foo' => "\x{e3}\x{81}\x{82}\x{e3}\x{81}\x{84}"
81 };
82
84 JSON::PP, json_xs
85
87 Makamaka Hannyaharamitu, <makamaka[at]cpan.org>
88
90 Copyright 2010 by Makamaka Hannyaharamitu
91
92 This library is free software; you can redistribute it and/or modify it
93 under the same terms as Perl itself.
94
95
96
97perl v5.16.3 2013-02-23 JSON_PP(1)