::JSON;
use strict;
use warnings;
use TBX::XCS;
use JSON;
use Carp;
#carp from calling package, not from here
our @CARP_NOT = qw(TBX::XCS::JSON);
use Exporter::Easy (
OK => [qw(xcs_from_json json_
in JSON
#default: read XCS file and dump JSON data to STDOUT
print json_from_xcs(TBX::XCS->new(file => $ARGV[0]))
unless caller;
sub json_from_xcs {
my ($xcs) = @_;
return to_json($xc
s->{data}, {utf8 => 1, pretty => 1});
}
sub xcs_from_json {
my ($json) = @_;
my $struct = decode_json $json;
_check_structure($struct);
my $xcs = {};
$xcs->{data} = $struct;
e warnings;
use XML::Twig;
use feature 'say';
use JSON;
use Carp;
#carp from calling package, not from here
our @CARP_NOT = qw(TBX::XCS TBX::XCS::JSON);
use Data::Dumper;
our $VERSION = '0.05'; # VERS
is
# PODNAME: xcs2json.pl
our $VERSION = '0.05'; # VERSION
# ABSTRACT: Print a JSON representation of the input XCS file
use TBX::XCS;
use TBX::XCS::JSON qw(json_from_xcs);
print json_from_xcs(TBX::XC
S->new(file => $ARGV[0]));
__END__
=pod
=head1 NAME
xcs2json.pl - Print a JSON representation of the input XCS file
=head1 VERSION
version 0.05
=head1 AUTHOR
Nathan Glenn <garfieldnate@gmail.c