DR::Tnt::Msgpack::Types - types for msgpack.
use DR::Tnt::Msgpack::Types; # pack as msgpack INT msgpack(mp_int(123)); # pack number as string msgpack(mp_string(123)); # bools msgpack(mp_true); msgpack(mp_false); msgpack(mp_bool(1)); msgpack(mp_bool(0)); # blob msgpack(mp_blob $blob);
Perl doesn't differ 123 and '123':
123
'123'
msgpack(123); msgpack('123'); # the same
From time to time You want to pack numbers as strings (for example You use tarantool's STR-index for user's texts, that contain numbers, too).
So You can use mp_string($) constructor for DR::Tnt::Msgpack::Types::Str.
mp_string($)
Create DR::Tnt::Msgpack::Types::Int object. Its method TO_MSGPACK packs number as msgpack signed integer value.
TO_MSGPACK
Create DR::Tnt::Msgpack::Types::Str object. Its method TO_MSGPACK packs perl scalar as msgpack string.
Create DR::Tnt::Msgpack::Types::Blob object. Its method TO_MSGPACK packs perl scalar as msgpack bin object.
Create DR::Tnt::Msgpack::Types::Bool object. Its method TO_MSGPACK package perl scalar as msgpack boolean.
To install DR::Tnt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DR::Tnt
CPAN shell
perl -MCPAN -e shell install DR::Tnt
For more information on module installation, please visit the detailed CPAN module installation guide.