Perl 6 Interface to libmsgpack
use v6;
use MsgPack;
my $data = [1, True, "Example", { "that" => "rocks" }];
my $packed = MsgPack::pack($data);
my $unpacked = MsgPack::unpack($packed);
say "data : " ~ $data.perl;
say "packed : " ~ $packed.perl;
say "unpacked : " ~ $unpacked.perl;
For more examples, please see the examples folder.
-
Please follow the section below to install
libmsgpack
on your system. -
Install it using zef (a module management tool bundled with Rakudo Star):
$ zef install MsgPack
Please follow the instructions below based on your platform:
- To install
msgpack
development headers / libraries, please run:
$ sudo apt-get install libmsgpack-dev
- To install
msgpack
development headers / libraries, please run:
$ brew update
$ brew install msgpack
Not supported at the moment but planned as a pre-built DLL in the near future.
TODO support windows with a pre-built DLL
- To run tests:
$ prove -ve "perl6 -Ilib"
- To run all tests including author tests (Please make sure Test::Meta is installed):
$ zef install Test::META
$ AUTHOR_TESTING=1 prove -e "perl6 -Ilib"
-
Most of the excellent tests here are based of the work of Pierre Vigier. Thanks for creating an excellent pure Perl 6 reference implementation.
Ahmad M. Zawawi, azawawi on #perl6
MIT License