DR::Tarantool::MsgPack(3pm)

DR::Tarantool::MsgPack3pm

Msgpack encoder/decoder.

Usage

    use DR::Tarantool::MsgPack 'msgpack', 'msgunpack', 'msgcheck';
    # encode object
    my $pkt = msgpack({ a => 'b' });
    # decode object
    my $object = msgunpack($pkt);
    # decode object with utf8-strings
    my $object = msgunpack($pkt, 1);
    # check if $string is valid msgpack
    $object = msgunpack($str, 1) if msgcheck($str);

Methods

msgpack($OBJECT)

Encode perl object (scalar, hash, array) to octets.

msgunpack($OCTETS[, $UTF8])

Decide octets to perl object. Return perl object and tail of input string.

If $UTF8 is true, msgunpack will decode utf8-strings.

true and false

Protocol supports "true" and "false" statements. msgunpack unpacks them to 1 and 0.

If You want to pack "true" You can use DR::Tarantool::MsgPack::Bool:

    use DR::Tarantool::MsgPack 'msgpack';
    my $to_pack = { a => DR::Tarantool::MsgPack::Bool->new(0) };
    my $pkt = msgpack($to_pack);

Releases

2 releases since Debian 9 (Stretch); the text changed 1 time.

  1. 9
  2. 10

From libdr-tarantool-perl 0.45-2+b2 in Debian 10 (Buster). Parsed by carta from the page's man source.