ed_selects{$or_self} = {};
# deep copy hash
require JSON::XS;
$hr_search = JSON::XS::decode_json(
JSON::XS::encode_json( $hr_search )
);
my (
$s_limit,
$s
sr/bin/perl
use strict;
use Data::Dumper;
use Cwd qw(cwd);
use Minio;
my $MObj = new Minio({
'json' => 1,
'debug' => 1,
'minio_client' => cwd().'/minio-mc',
'minio_config_dir' => cwd().'/min
umper($LS);
#my $LS = $MObj->LS({minio_path=>'myminio/pub/00'});
#print Data::Dumper::Dumper($LS);
#my $Tree = $MObj->Tree({minio_path=>'myminio/pub',json=>0});
#print Data::Dumper::Dumper($Tree);
r;
use strict;
use warnings;
use parent 'FusionInventory::Agent::Task::Inventory::Module';
use JSON::PP;
use FusionInventory::Agent::Tools;
use FusionInventory::Agent::Tools::Virtualization;
# wa
= @_;
my $lines = getAllLines(%params);
my $status = '';
eval {
my $coder = JSON::PP->new;
my $containerData = $coder->decode($lines);
$status =
((ref
200,
'OK',
HTTP::Headers->new( 'Content-Type' => 'application/json' ),
'{}'
);
$client->send_response($response);
return 200;
WMI => \&_getFromWMI
);
# How to validate JSON for retreived jobs
sub _OPTIONAL { 0 }
sub _MANDATORY { 1 }
sub _OPTIONAL_EXCLUSIVE { 2 }
my %json_validation = (
getFromRegistry => {
$self->{logger}->debug("Bad JSON: No answer from server.");
return 0;
}
if (ref($answer) ne 'HASH') {
$self->{logger}->debug("Bad JSON: Bad answer from server. Not a ha
efined($answer->{jobs}) || ref($answer->{jobs}) ne 'ARRAY') {
$self->{logger}->debug("Bad JSON: Missing jobs");
return 0;
}
foreach my $job (@{$answer->{jobs}}) {
for
= 65536;
our %LOADED;
our @DEFAULT_PARSER = qw/
OctetStream
UrlEncoded
MultiPart
JSON
/;
for my $parser ( @DEFAULT_PARSER ) {
load "HTTP::Entity::Parser::".$parser;
$LOADED{"H
t/form-data','HTTP::Entity::Parser::MultiPart');
$parser->register('application/json','HTTP::Entity::Parser::JSON');
sub app {
my $env = shift;
my ( $params, $uploads) = $pars
s it.
This module supports application/x-www-form-urlencoded, multipart/form-data and application/json.
=head1 METHODS
=over 4
=item new( buffer_length => $length:Intger)
Create the instance.
=ov
rn 0;
}
my $msg;
if (!_validateAnswer(\$msg, $answer)) {
$logger->debug("bad JSON: ".$msg);
return 0;
}
foreach my $sha512 ( keys %{ $answer->{associatedFiles} }
if ( !$files->{$uuid} ) {
$logger->error("unknown file: '$uuid'. Not found in JSON answer!");
next;
}
push @$associatedFiles, $f
iatedFiles != @{$job->{associatedFiles}}) {
$logger->error("Bad job definition in JSON answer!");
next;
}
}
push @$jobList, FusionInventory
arnings;
use parent 'FusionInventory::Agent::HTTP::Client';
use English qw(-no_match_vars);
use JSON::PP;
use HTTP::Request;
use HTTP::Headers;
use HTTP::Cookies;
use URI::Escape;
my $log_prefix =
r};
return;
}
my $answer;
eval {
my $decoder = JSON::PP->new
or die "Can't use JSON::PP decoder: $!";
$answer = $decoder->decode($content);
};
= split(/\n/, $content);
$self->{logger}->error(
$log_prefix . "Can't decode JSON content, starting with $lines[0]"
) if $self->{logger};
return;
}
return
f $found->{"/file_set_visible_version"};
# Try to find license "expiry_date" from a specific json file
$fsecReg = _getSoftwareRegistryKeys(
'F-Secure\CCF\DLLHoster\100\Plugins\CosmosS
h for the expected json file
$path .= "\\safe.S-1-5-18.local.cosmos";
return unless -f $path;
my $infos = getAllLines(file => $path);
return unless $infos;
JSON::PP->require();
my @licenses;
eval {
$infos = JSON::PP::decode_json($infos);
@licenses = @{$infos->{local}->{windows}->{secl}->{subscription}->{license_table}};
};
return unless @licens
::librdkafka> is an C<Alien> interface to L<librdkafka|https://github.com/edenhill/librdkafka>,
a JSON encoder/decoder in C.
=head1 AUTHOR
B Fraser, C<< <fraserbn at gmail.com> >>
=head1 BUGS
Plea
::UserAgent;
use HTTP::Request::Common;
use Log::Any ();
use Cache::LRU;
use Clone qw(clone);
use JSON;
use URI::Template;
use RDF::LDF::Error;
our $VERSION = '0.251';
has url => (
is => 'ro' ,
fo("fetching: $url");
my $model = RDF::Trine::Model->temporary_model;
# JSON support in RDF::Trine isn't JSON-LD
# Set the accept header quality parameter at a minimum for this format
pplication/x-turtle;q=1.0,application/rdf+xml;q=0.9,text/x-nquads;q=0.9,application/json;q=0.1,application/x-rdf+json;q=0.1');
eval {
# Need to explicitly set the useragent to keep the ac
n;
use strict;
use warnings;
use parent 'FusionInventory::Agent::Task::Inventory::Module';
use JSON::PP;
use FusionInventory::Agent::Tools;
use FusionInventory::Agent::Tools::Network;
sub isEnable
%params
) or return;
my @interfaces;
eval {
my $json = JSON::PP->new;
my $data = $json->decode($lines);
foreach my $record (@$data) {
while (m
;
use RDF::Query;
use Getopt::Long;
use utf8;
use Encode;
use JSON ();
my $JSON = JSON->new->utf8->allow_nonref;
sub encode_json { $JSON->encode(@_) }
my ($subject,$predicate,$object);
@ARGV = map
":%s,\"object\":%s}\n",
encode_json($st->subject->value),
encode_json($st->predicate->value),
encode_json($st->object->value);
}
}
print
}
$h->{$v} = $val;
}
print (",\n") if ($count++ > 0);
print encode_json($h);
}
print "\n";
}
print "]\n";
}
package #
Template::Plugin::JSON;
our $AUTHORITY = 'cpan:JWRIGHT';
our $ALT = 'Moo';
use Types::Standard ();
use Carp ();
use JSON ();
use Alt::Template::Plugin::JSON::Moo;
use Moo;
use namespa
ard::Object,
is => "ro",
weak_ref => 1,
);
has json_converter => (
isa => Types::Standard::Object,
is => "lazy",
lazy_build => 1,
);
has json_args => (
isa => Types::Standard::HashRef,
is
uses JSON/JSON::XS now";
}
my $args = ref $args[0] ? $args[0] : {};
return { %$args, context => $c, json_args => $args };
}
sub _build_json_converter {
my $self = shift;
my $json = JSON->new
ION
C<Alien::libjansson> is an C<Alien> interface to L<libjansson|https://digip.org/jansson/>,
a JSON encoder/decoder in C.
=head1 AUTHOR
B Fraser, C<< <fraserbn at gmail.com> >>
=head1 BUGS
Plea
package Minio;
use 5.006001;
use strict;
use utf8;
use JSON::XS;
=head1 NAME
Minio - interface to minio client
=head1 VERSION
Version 0.04
=cut
our $VERSION = '0.07';
=head1 SYNOPSIS
use Mi
ub/00/11/22/33/44/file.txt'});
print $Cat;
my $Tree = $MObj->Tree({minio_path=>'myminio/pub',json=>0});
print $Tree;
my $Look = $MObj->Lookup({minio_path=>'myminio/pub/00/11/22/33/44/file.tx
nfig path or config corrupted. Use 'minio_config_dir' parameter.: ".$Check;
}
$X->{'json'} = $Args->{'json'} || 1;
$X->{'debug'} = $Args->{'debug'} || 0;
$X->{'minio_exe'} = $MinioEXE;
$X->
/rpc")->over(
headers => {
'Content-Type' => 'application/json-rpc'
}
)->to(
controller => 'jsonrpc',
action => 'handler',
cors_origin => ["http:
rface (like SWITCH or ROUTER interface)
Perhaps a little code snippet.
The HASH is easily using a JSON file
use FSM::Basic;
my $fsm = FSM::Basic->new( \%states, 'accept' );
my $final = 0
nds
e.g.
"h(elp)?|\\?": {
"output": "default\nexit\ntimeoutA\n__PROMPT__"
}
This json section match for 'h' 'help' or '?'
In the regex, the group capture could be used in the comma
d timer usage
In this example if destination IP from the SSH connection is available, the file IP.json is used as definition
(with fallback to fake_bash1.pl)
=cut
sub new {
my ($class, $l, $s) =
if (-e $path) {
$self->{dashboards} = { map { m{.*/([^/]+)\.json$}; $1 => 1 } glob "$path/authors/*.json" };
}
}
}
sub get_vcs {
my ($repository) = @_;
if ($repo
odule have new versions as well - if a module is maintained.
=cut
use LWP::UserAgent;
use JSON qw(from_json);
use Data::Dumper qw(Dumper);
print Dumper get('1995-10-05T00:00:00', '2095-10-10T00:00:
"size" : $limit
}
});
my $res = $ua->request($req);
if ($res->is_success) {
my $result = from_json $res->content;
return $result->{hits}{hits};
} else {
die $res->status_line;
}
}