m can also be written to NeXML (L<http://www.nexml.org>) using
C<to_xml> and to a JSON mapping thereof using C<to_json>.
=back
=head2 Input and output
The L<Bio::Phylo::IO> module is the unified fr
#!/usr/bin/perl
use strict;
use warnings;
use Net::AMQP::RabbitMQ;
use Getopt::Long;
use JSON;
use Time::HiRes qw(sleep);
our $VERSION = '0.1';
my $hostname = 'localhost';
my $user = 'guest';
my $pa
$i = 0;
while ($i < $messages) {
my $uuid = time() * rand(10000) + $i;
my $msg_body = to_json({msg => sprintf("Message number %d", $i), uuid => $uuid});
$mq->publish($channel, $queue, $ms
CMS::Controller::Site;
use parent 'App::Office::CMS::Controller';
use strict;
use warnings;
use JSON::XS;
use Try::Tiny;
# We don't use Moo because we isa CGI::Application.
our $VERSION = '0.93';
p the displayed site
# and the displayed search results, because that data is obsolete.
return JSON::XS -> new -> utf8 -> encode
({
results =>
{
message => $message,
target_div => 'se
reen (under the Edit Site tab).
# It appears there by virtue of being within search.tx.
return JSON::XS -> new -> utf8 -> encode
({
results =>
{
message => $self -> param('view') -> site
S::Controller::Design;
use parent 'App::Office::CMS::Controller';
use strict;
use warnings;
use JSON::XS;
use Try::Tiny;
# We don't use Moo because we isa CGI::Application.
our $VERSION = '0.93';
reen (under the Edit Site tab).
# It appears there by virtue of being within search.tx.
return JSON::XS -> new -> utf8 -> encode
({
results =>
{
message => $message,
target_div => 'se
reen (under the Edit Site tab).
# It appears there by virtue of being within search.tx.
return JSON::XS -> new -> utf8 -> encode
({
results =>
{
message => $message,
target_div => 'up
#!/usr/bin/perl
use strict;
use warnings;
use Carp;
use JSON;
use Getopt::Long;
use Data::Dumper;
use lib './lib';
use Net::AMQP::RabbitMQ::Batch;
use Time::HiRes qw(sleep);
our $VERSION = '0.3000';
$msg (@$messages) {
my $body = from_json($msg->{body});
$body->{processed} = 1;
my $new_msg = {
body => to_json($body)
};
push(@$new_mesage
ace for the http://pln.pt web service
$PLN::PT::VERSION = '0.008';
use strict;
use warnings;
use JSON::XS;
use CHI;
use Digest::MD5 qw/md5_base64/;
use LWP::UserAgent;
use Encode;
use utf8::all;
sub
turn undef;
}
}
return $data if ($opts->{output} and $opts->{output} eq 'raw');
return JSON::XS->new->decode($data);
}
sub _get {
my ($self, $url, $opts) = @_;
my $key = $url . '-' .
turn undef;
}
}
return $data if ($opts->{output} and $opts->{output} eq 'raw');
return JSON::XS->new->decode($data);
}
sub _cat {
my ($self, @args) = @_;
my @parts = ($self->{url});
S::Controller::Backup;
use parent 'App::Office::CMS::Controller';
use strict;
use warnings;
use JSON::XS;
use Try::Tiny;
# We don't use Moo because we isa CGI::Application.
our $VERSION = '0.93';
ssage_div is on screen (under the Edit Content tab)
# because we're displaying content.
return JSON::XS -> new -> utf8 -> encode({results => $result});
} # End of run.
# -------------------------
CMS::Controller::Page;
use parent 'App::Office::CMS::Controller';
use strict;
use warnings;
use JSON::XS;
use Try::Tiny;
# We don't use Moo because we isa CGI::Application.
our $VERSION = '0.93';
on screen (under the Edit Pages tab),
# because we're displaying a page using page.tx.
return JSON::XS -> new -> utf8 -> encode({results => $result});
} # End of add_child.
# -------------------
on screen (under the Edit Pages tab),
# because we're displaying a page using page.tx.
return JSON::XS -> new -> utf8 -> encode({results => $result});
} # End of add_sibling_above.
# -----------
{
return;
}
}
class DBIx::Deployer 1.2.3 {
use DBI;
use DBD::SQLite;
use JSON::XS;
use Term::ANSIColor;
use autodie;
has target_db => ( is => 'lazy', isa => Insta
atch_files){
my $json;
{
local $/ = undef;
open(my $fh, '<', $self->patch_path . '/' . $file);
$json = <$fh>;
cl
ose($fh);
}
$json=~s/\n|\r\n/ /gm unless $self->keep_newlines;
my $patch_array = JSON::XS::decode_json($json);
foreach my $patch (@$patch_ar
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT =
qw(is_type is_atoms to_ejson from_ejson char_to_ejson atoms flat match name value offline elen epush eappend eunshift ejoin is_atom_name i
}
return 1;
}
sub to_ejson {
my $json = shift;
if (is_estr($json)) { return $json }
my $chars = [];
my $mode = 0;
for my $ch (split '', $json) {
if ($mode == 0) {
lt { push @{$chars}, $ch; }
}
}
}
return join '', @{$chars};
}
sub from_ejson {
my $estr = shift;
if (is_str($estr)) { return $estr }
my $chars = [];
my $mode = 0
'data' => {
'data_type' => 'VARCHAR',
'size' => 255,
'serializer_class' => 'JSON',
}
);
__PACKAGE__->add_hash_accessor( da => 'data' );
In code
# Access key in hash
loyee rest_error );
use Data::Dumper;
use Exporter 'import';
use File::Slurp;
use File::Temp;
use JSON;
use Web::MREST::CLI qw( send_req );
=head1 NAME
App::Dochazka::CLI::Shared - Shared routine
dule code (scode): " . $scode . "\n";
}
# decode the schedule
my $sch_array = decode_json( $sch->schedule );
foreach my $entry ( @$sch_array ) {
$ps .= ' 'x$ARGS{'indent'} if
tivity aid $JSON
sub _method_activity_aid {
my ( $ts, $th ) = @_;
my $method = $ts->[0];
return [ $method, "activity/aid", $th->{_JSON} ];
}
# $METHOD activity aid $AID [$JSON]
sub _meth
ity code $JSON
sub _method_activity_code {
my ( $ts, $th ) = @_;
my $method = $ts->[0];
return [ $method, "activity/code", $th->{_JSON} ];
}
# $METHOD activity code $CODE [$JSON]
sub _me
s->[0];
return [ $method, "interval/fillup", $th->{_REST} ];
}
# $METHOD interval iid $IID $JSON
sub _method_interval_iid {
my ( $ts, $th ) = @_;
my $method = $ts->[0];
my $iid = $th
'((mon\S*)|(tue\S*)|(wed\S*)|(thu\S*)|(fri\S*)|(sat\S*)|(sun\S*))',
_HYPHEN => '(-)',
_JSON => '(\{[^\{]*\})',
_MONTH => '((jan\S*)|(feb\S*)|(mar\S*)|(apr\S*)|(may\S*)|(jun\S*)|(
TIVITY AID _JSON" => \&_method_activity_aid,
"PUT ACTIVITY AID _JSON" => \&_method_activity_aid,
"POST ACTIVITY AID _JSON" => \&_method_activity_aid,
"DELETE ACTIVITY AID _JSON" => \&_meth
TY CODE _JSON" => \&_method_activity_code,
"PUT ACTIVITY CODE _JSON" => \&_method_activity_code,
"POST ACTIVITY CODE _JSON" => \&_method_activity_code,
"DELETE ACTIVITY CODE _JSON" => \&_m
EID _JSON" => \&_method_employee_eid_json,
"PUT EMPLOYEE EID _JSON" => \&_method_employee_eid_json,
"POST EMPLOYEE EID _JSON" => \&_method_employee_eid_json,
"DELETE EMPLOYEE EID _JSON" =>
h;
use warnings;
use strict;
our $VERSION = '0.16';
use File::Spec;
use Text::Diff 'diff';
use JSON::Util;
use Digest::MD5 qw(md5_hex);
use List::MoreUtils 'any', 'none';
use Carp 'croak', 'confess
ms.json'
);
if (@args) {
print 'Updating ', $checksums_filename, "\n";
my %conffiles_md5 = (
$self->install_checksums,
@args,
);
JSON::
}
# create empty json file if non available
JSON::Util->encode({}, [ $checksums_filename ])
if not -f $checksums_filename;
return %{JSON::Util->decode([ $checksums_fi
atus->payload );
}
=head2 generate_report
GENERATE REPORT _PATH $PARAMETERS_JSON
Example $PARAMETERS_JSON: { "name" : "John Doe" }
=cut
sub generate_report {
print "Entering " . __PA
= $th->{_PATH};
my $entity = "{ \"path\": \"$path\"";
$entity .= ", \"parameters\": " . $th->{_JSON} if $th->{_JSON};
$entity .= " }";
return shared_generate_report( $entity );
}
1;
XPORT = qw(End In Out True False Qstr Qint Blank
clean first string strings sort_array to_json from_json
is_exists first_char last_char rest_str tail rest
is_string is_int is_array Chop add u
w(fileparse);
use Perl::Tidy;
use File::Copy qw(copy);
use String::Random;
use JSON::XS qw(decode_json encode_json);
use Carp;
use constant {
End => chr(0),
In => chr(1),
Out =
sub error { say @_; exit() }
sub to_json {
my $data = shift;
return encode_json($data);
}
sub from_json {
my $data = shift;
return decode_json($data);
}
sub clean {
my $stack
( $emp_spec->can('eid') ) {
$status = $CELL->status_ok( 'DUMMY', payload => $emp_spec->TO_JSON );
} elsif ( ref( $emp_spec ) eq '' ) {
$status = lookup_employee( key => $emp_spec )