Defaults to false, unless C<uuid.h> can be found and you have a compiler.
=item L<JSON::XS>
Provides faster JSON performance.
Defaults to true if you have a compiler.
=item L<YAML::XS>
Allows d
package App::PipeFilter::JsonMap;
{
$App::PipeFilter::JsonMap::VERSION = '0.005';
}
use Moose;
extends 'App::PipeFilter::Generic::Json';
has i => (
is => 'rw',
isa => 'Arr
lter::JsonMap - map input fields to output fields by renaming them
=head1 VERSION
version 0.005
=head1 SYNOPSIS
#!/usr/bin/perl
use App::PipeFilter::JsonMap;
exit App::PipeFilter::JsonMap->n
ilter::JsonMap implements the jmap(1) pipeline filter. It
renames JSON object fields by mapping input field names to new ones on
output.
This class subclasses L<App::PipeFilter::Generic::Json>.
=he
::JsonSort;
{
$App::PipeFilter::JsonSort::VERSION = '0.005';
}
use Moose;
extends 'App::PipeFilter::Generic';
with qw(
App::PipeFilter::Role::Reader::Sysread
App::PipeFilter::Role::Input::Json
App::PipeFilter::Role::Writer::Print
App::PipeFilter::Role::Transform::None
);
use JSON::XS;
has k => (
is => 'rw',
isa => 'ArrayRef',
default => sub { die "requ
("\t", @sortable{@fields}, encode_json($_)) . "\n";
} @_;
}
1;
__END__
=pod
=head1 NAME
App::PipeFilter::JsonSort - a sort(1)-like filter that understands JSON fields
=head1 VERSION
version 0
=> Cow::Teeth->new,
);
And you want a hash containing some of those fields (perhaps to pass to
JSON::XS, or something). Then you can do this:
use Parse::FieldPath qw/extract_fields/;
my $cow_
les => (
isa => 'ArrayRef',
is => 'rw',
auto_deref => 1,
);
sub TO_JSON {
my $self = shift;
my %ret;
for my $k (qw/id username password crypted_password hash
g',
png => 'image/png',
bmp => 'image/bmp',
gif => 'image/gif',
json => 'application/x-json',
css => 'text/css',
pdf => 'application/x-pdf',
js => 'text/javas
= sub { $args{$param}->TO_JSON; } };
eval { $params->{$param} = delete($args{$param})->TO_JSON; };
if($@) {
throw_param error => "Could not jsonize $param: $@";
RCBot;
use 5.010;
use strict;
use warnings;
our $VERSION = '0.01_01';
use AnyEvent::Redis;
use JSON;
=head1 NAME
ZenIRCBot - Perl API for ZenIRCBot
=head1 SYNOPSIS
use ZenIRCBot;
my $bot =
ent->subscribe('in', sub {
my ($raw, $channel) = @_;
my $json = JSON->new->allow_nonref;
my $msg = $json->decode($raw);
&{$func}($msg, $channel);
});
}
# Blocking
$to];
}
for my $channel (@{$to}) {
my $json = JSON->new->allow_nonref->allow_blessed->convert_blessed;
my $data = $json->encode({
version => 1,
type =>
$stream_with_options = new AMF::Connection::InputStream($binary_buffer_or_string, 'prefer_number, json_boolean');
my $int = $stream->readInt();
my $long = $stream->readLong();
# ..
=head1 DES
d1 NAME
ASP4::ErrorHandler - Default fatal error handler
=head1 SYNOPSIS
In your C<asp4-config.json>:
...
"errors": {
"error_handler": "ASP4::ErrorHandler",
"mail_errors_to":
onse->Redirect("/login/");
}# end if()
}
1;# return true:
Then, in your C<asp4-config.json>:
{
...
"web": {
...
"request_filters": [
{
"uri_match":
package App::PipeFilter::MysqlToJson;
{
$App::PipeFilter::MysqlToJson::VERSION = '0.005';
}
use Moose;
extends 'App::PipeFilter::Generic';
with qw(
App::PipeFilter::Role::Reader::LineByLine
Ap
p::PipeFilter::Role::Output::Json
App::PipeFilter::Role::Transform::None
);
use JSON::XS;
has _fields => (
is => 'rw',
isa => 'ArrayRef',
);
before filter_file => sub {
my ($self, $ifh, $o
ysqlToJson - translate mysql batch output to JSON
=head1 VERSION
version 0.005
=head1 SYNOPSIS
Here is the mysql2json(1) pipeline filter.
#!/usr/bin/perl
use App::PipeFilter::MysqlToJson;
e
<VirtualHost *:80>
...
PerlTransHandler ASP4x::Router
...
</VirtualHost>
% asp4-config.json
...
"web": {
...
"request_filters": [
...
{
"uri_match": "/.*",
...
]
...
"routes": [
{
"include_routes": "@ServerRoot@/conf/routes.json"
},
{
"name": "CreatePage",
"path": "/main/:type/create",
erally B<*thousands*> of different entries in the "C<routing>"
section of your C<conf/asp4-config.json> file, performance should be B<quite> fast.
=head2 Where can I learn more?
Please see the docum
::PipeFilter::JsonCut;
{
$App::PipeFilter::JsonCut::VERSION = '0.005';
}
use Moose;
extends 'App::PipeFilter::Generic::Json';
# TODO - Refactor into a common role? Duplicated in JsonToTsv.pm.
ha
Filter::JsonCut - return specified fields from a JSON stream
=head1 VERSION
version 0.005
=head1 SYNOPSIS
Here is the jcut(1) pipeline filter.
#!/usr/bin/perl
use App::PipeFilter::JsonCut;
exit App::PipeFilter::JsonCut->new_with_options()->run();
=head1 DESCRIPTION
App::PipeFilter::JsonCut implements the jcut(1) pipeline filter. It's
modeled after the UNIX cut(1) utility.
Please see
ixtures.json' )
{
eval { require Data::Properties::JSON };
$test_data = Data::Properties::JSON->new(
properties_file => $config->web->application_root . '/etc/test_fixtures.json'
)
e Catalyst::Plugin::Snippets;
use strict;
use warnings;
use MRO::Compat;
BEGIN { eval { require JSON::Syck } }
our $VERSION = "0.03";
sub setup {
my $app = shift;
my $ret = $app->maybe::ne
n",
allow_refs => 1,
use_session_id => 0,
json_content_type => "application/javascript+json",
content_type => "text/plain",
%{ $app->config->{sni
ponse->body($body);
}
sub _send_snippet_json {
my ( $c, $options, $value ) = @_;
$c->_send_snippet(
$options->{json_content_type},
JSON::Syck::Dump($value),
);
}
sub _sen
sor role for ProcessInstance and ActivityInstance
use namespace::autoclean;
use Moose::Role;
use JSON;
use BPM::Engine::Util::ExpressionEvaluator;
use BPM::Engine::Exceptions qw/throw_store throw_par
lue));
$init->{ScriptType} ||= '';
if($init->{ScriptType} eq 'json') {
$ivalue = decode_json($ivalue);
}
else {
$ivalue = $expr->render($iv
e XML::Twig;
use Data::SCORM::Organization;
use Data::SCORM::Item;
use Data::SCORM::Resource;
use JSON::Any;
use Data::Dumper;
=head1 NAME
Data::SCORM::Manifest - represent the Manifest
=head1 SYN
rn $class->new(%data);
}
sub as_hoh {
# turn this into a normal perl data structure that we can jsonnify
my ($self, $url_base) = @_;
$url_base ||= '';
my %organizations = map {
my $org_name =
zations,
};
}
sub to_json {
my $self = shift;
my $hoh = $self->as_hoh(@_); # e.g. the $url_base param
my $js = JSON::Any->new( allow_blessed => 1 );
return $js->to_json($hoh);
}
# __PACKAGE__
rict;
use warnings 'all';
use Carp 'confess';
use ASP4::ConfigFinder;
use ASP4::ConfigParser;
use JSON::XS;
our $Configs = { };
#====================================================================
$ifh, '<', $path
or die "Cannot open '$path' for reading: $!";
local $/;
my $doc = decode_json( scalar(<$ifh>) );
close($ifh);
(my $where = $path) =~ s/\/conf\/[^\/]+$//;
$Configs->{$
hed on a per-path basis. Paths are full - i.e. C</usr/local/projects/mysite.com/conf/asp4-config.json> -
so there should never be a clash between two different configurations on the
same web server,
package App::PipeFilter::JsonToPcap;
{
$App::PipeFilter::JsonToPcap::VERSION = '0.005';
}
use Moose;
extends 'App::PipeFilter::Generic';
with (
"App::PipeFilter::Role::Reader::Sysread",
"App::
PipeFilter::Role::Input::Json",
"App::PipeFilter::Role::Transform::None",
"App::PipeFilter::Role::Opener::PcapOutput",
"App::PipeFilter::Role::Output::Pcap",
"App::PipeFilter::Role::Writer::Pca