package JSON::ize;
use base Exporter;
use JSON::MaybeXS;
use YAML::Any qw/Dump Load LoadFile DumpFile/;
use Try::Tiny;
use strict;
use warnings;
our $JOBJ = JSON::MaybeXS->new();
our $YOBJ;
our $_las
t_out = "";
our @EXPORT = qw/jsonize jsonise J yamlize yamlise Y parsej pretty_json ugly_json/;
our $VERSION = "0.202";
sub jobj { $JOBJ }
sub jsonize (;$) {
my $inp = shift;
if (!defined $inp)
p) : jobj()->encode($inp);
}
else { # scalar: decode if looks like json or yaml, or slurp if filename
if (looks_like_json($inp)) {
return $_last_out = jobj()->decode($inp);
}
els