y %opt = ( quote => 1, sep => ' ' );
GetOptions( \%opt, 'sep|s=s', 'flat|flatten|f', 'quote|q!', 'json|j' ) or pod2usage(2);
gonzlog->tee_stderr(0);
gonzlog->namespace("gonzconf");
my @args = @ARGV;
$res = $res->{$a};
} else {
die "could not access the structure: $a";
}
}
if ( $opt{json} ) {
print jfreeze $res;
} elsif ( $opt{flat} && ref $res eq 'ARRAY' ) {
my $args;
if ( $op
:JSON::XS;
use Data::Dumper;
use Storable qw/nstore_fd fd_retrieve/;
our $VERSION = '0.090'; # VERSION
our %EXPORT_TAGS = (
'all' => [
qw(
ndjson_iterate ndjson_hash ndjson_slurp ndjson_
spew
ndjson_freeze ndjson_thaw
ythaw yfreeze yslurp yspew
jthaw jfreeze jslurp jspew
stoslurp stospew
)
],
std => [
qw(
ythaw yfreeze yslurp yspew
jthaw
*jthaw = \&Cpanel::JSON::XS::decode_json;
}
our $JSON = Cpanel::JSON::XS->new->indent(1)->utf8->allow_nonref;
sub jfreeze {
my $r;
my @d = @_;
try {
$r = $JSON->encode(@d);
} catch
"format" => hidden => {
one_of => [ [ "json|j" => "output in json format" ], [ "yaml|y" => "output in yaml format" ], ],
default => 'json'
}
],
[ 'alt_id', 'include alter
unless ( $opt->syn );
$go{$syn} = $t->acc;
}
}
$errhandler->finish;
if ( $opt->format eq 'json' ) {
jspew( \*STDOUT, \%go );
} elsif ( $opt->format eq 'yaml' ) {
yspew( \*STDOUT, \%go );
}
se Algorithm::Loops qw/MapCarU/;
use Bio::Gonzales::Matrix::Util;
use Data::Dumper;
use Cpanel::JSON::XS;
use Clone;
# Imports hier
use Moo;
use namespace::clean;
our $VERSION = 0.01_01;
our $N
}
sub encode_as_json {
my $self = shift;
my $js = Cpanel::JSON::XS->new->utf8->allow_nonref->indent(1); #->canonical(1);
return $js->encode( $self->as_hash );
}
sub json_spew {
my ( $s
f ) = @_;
open my $fh, '>', $f or die "Can't open filehandle: $!";
print $fh $self->encode_as_json;
close $fh;
}
sub subset {
my ( $self, $cb ) = @_;
my $assay = $self->assay;
m
"format" => hidden => {
one_of => [ [ "json|j" => "output in json format" ], [ "yaml|y" => "output in yaml format" ], ],
default => 'json'
}
],
[
"relation" => hidden => {
ess ( $opt->syn );
$go{$syn} = \@rel_terms;
}
}
$errhandler->finish;
if ( $opt->format eq 'json' ) {
jspew( \*STDOUT, \%go );
} elsif ( $opt->format eq 'yaml' ) {
yspew( \*STDOUT, \%go );
}