Group
Extension

Matches 1

Ion ( J/JE/JEFFOBER/Ion-0.08.tar.gz, JEFFOBER, 2018; MetaCPAN )
Ion/lib/Ion.pm ( view source; MetaCPAN )
e';
  use JSON::XS qw(encode_json decode_json);
  use Ion;

  my ($r, $w) = portable_pipe;
  my $in  = Connect(unblock($r)) << \&decode_json;
  my $out = Connect(unblock($w)) >> \&encode_json;

=head1
the raw line
data.

=head2 EXAMPLE: JSON

  use Ion;
  use JSON::XS;

  my $server = Listen;
  $server <<= sub{ decode_json(shift) };
  $server >>= sub{ encode_json(shift) };

  while (my $conn = <$se
{              # $data is perl data
      $conn->({foo => 'bar', baz => 'bat'});  # $conn is sent json: "{'foo': 'bar', 'baz': 'bat'}"
    }
  }

=head2 EXAMPLE: CHAINING

  use Ion;
  use Data::Dumpe

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.