CBOR::PP::Decode
my $perlvar = CBOR::PP::Decode::decode($binary);
This implements a basic CBOR decoder in pure Perl.
All tags are ignored. (This could be iterated on later.)
Indefinite-length objects are supported, but streamed parsing is not; the data structure must be complete to be decoded.
CBOR text strings are decoded to UTF8-flagged strings, while binary strings are decoded to non-UTF8-flagged strings. In practical terms, this means that a decoded CBOR binary string will have no code point above 255, while a decoded CBOR text string can contain any valid Unicode code point.
null, undefined, true, and false become undef, undef, Types::Serialiser::true(), and Types::Serialiser::false(), respectively. (NB: undefined is deserialized as an error object in CBOR::XS, which doesn’t seem to make sense.)
Add tag decode support via callbacks.
Make it faster by removing some of the internal buffer copying.
Gasper Software Consulting (FELIPE)
This code is licensed under the same license as Perl itself.
Returns a Perl value that represents the serialized CBOR string.
To install CBOR::PP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CBOR::PP
CPAN shell
perl -MCPAN -e shell install CBOR::PP
For more information on module installation, please visit the detailed CPAN module installation guide.