ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/bin/json_xs
(Generate patch)

Comparing JSON-XS/bin/json_xs (file contents):
Revision 1.2 by root, Sat Mar 22 22:26:52 2008 UTC vs.
Revision 1.3 by root, Sun Mar 30 09:27:16 2008 UTC

100=cut 100=cut
101 101
102use strict; 102use strict;
103 103
104use Getopt::Long; 104use Getopt::Long;
105use Storable; 105use Storable ();
106use Encode; 106use Encode;
107 107
108use JSON::XS; 108use JSON::XS;
109 109
110my $opt_verbose; 110my $opt_verbose;
128 : /^.\x00.\x00/s ? "utf-16le" 128 : /^.\x00.\x00/s ? "utf-16le"
129 : "utf-8"; 129 : "utf-8";
130 warn "input text encoding is $enc\n" if $opt_verbose; 130 warn "input text encoding is $enc\n" if $opt_verbose;
131 JSON::XS->new->decode (decode $enc, $_) 131 JSON::XS->new->decode (decode $enc, $_)
132 }, 132 },
133 "storable" => sub { thaw $_ }, 133 "storable" => sub { Storable::thaw $_ },
134 "storable-file" => sub { open my $fh, "<", \$_; Storable::fd_retrieve $fh }, 134 "storable-file" => sub { open my $fh, "<", \$_; Storable::fd_retrieve $fh },
135 "clzf" => sub { require Compress::LZF; Compress::LZF::sthaw ($_) }, 135 "clzf" => sub { require Compress::LZF; Compress::LZF::sthaw ($_) },
136 "yaml" => sub { require YAML; YAML::Load ($_) }, 136 "yaml" => sub { require YAML; YAML::Load ($_) },
137); 137);
138 138

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines