Data::MessagePack::Unpacker - messagepack streaming deserializer
use Data::Dumper; my $up = Data::MessagePack::Unpacker->new; open my $fh, $data or die $!; my $offset = 0; while( read($fh, my $buf, 1024) ) { $offset = $up->execute($buf, $offset); if($up->is_finished) { print Dumper($up->data); } }
This is a streaming deserializer for messagepack.
creates a new instance of the stream deserializer.
sets utf8 mode. true if $bool is omitted. returns $up itself.
If utf8 mode is enabled, strings will be decoded as UTF-8.
The utf8 mode is disabled by default.
returns the utf8 mode flag of $up.
parses unpacked $data from $offset to $limit. returns a new offset of $data, which is for the next <execute()>.
If $data is insufficient, $offset does not change, saving $data in internal buffers.
is this deserializer finished?
returns the deserialized object.
resets the stream deserializer, without memory zone.
Tokuhiro Matsuno
Data::MessagePack
To install Data::MessagePack, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::MessagePack
CPAN shell
perl -MCPAN -e shell install Data::MessagePack
For more information on module installation, please visit the detailed CPAN module installation guide.