8001;
use strict;
use warnings;
our $VERSION = "0.02";
use JSON::XS ();
use JSON::Color ();
my $_coder;
sub _coder {
$_coder ||= JSON::XS->new->pretty(1);
}
sub new_with_options {
my ($cla
lf, $json) = @_;
($self->{printer} ||= do {
!$self->{color} ? sub { chomp(my $l = $_coder->encode(shift)); $l} : sub { JSON::Color::encode_json(shift, {pretty => 1}) }
})->($json);
}
{
my $pre = $`;
my $maybe_json = $&;
my $post = $';
my $json;
eval {
$json = _coder->decode($maybe_json);
};
if (!$@) {