… | |
… | |
64 | |
64 | |
65 | package CBOR::XS; |
65 | package CBOR::XS; |
66 | |
66 | |
67 | use common::sense; |
67 | use common::sense; |
68 | |
68 | |
69 | our $VERSION = 1.82; |
69 | our $VERSION = 1.83; |
70 | our @ISA = qw(Exporter); |
70 | our @ISA = qw(Exporter); |
71 | |
71 | |
72 | our @EXPORT = qw(encode_cbor decode_cbor); |
72 | our @EXPORT = qw(encode_cbor decode_cbor); |
73 | |
73 | |
74 | use Exporter; |
74 | use Exporter; |
… | |
… | |
792 | sub CBOR::XS::as_bool ($) { $_[0] ? $Types::Serialiser::true : $Types::Serialiser::false } |
792 | sub CBOR::XS::as_bool ($) { $_[0] ? $Types::Serialiser::true : $Types::Serialiser::false } |
793 | |
793 | |
794 | sub CBOR::XS::as_map ($) { |
794 | sub CBOR::XS::as_map ($) { |
795 | ARRAY:: eq ref $_[0] |
795 | ARRAY:: eq ref $_[0] |
796 | and $#{ $_[0] } & 1 |
796 | and $#{ $_[0] } & 1 |
797 | or do { require Carp; Carp::croak ("CBOR::XS::as_map only acepts array references with an even number of elements, found ") }; |
797 | or do { require Carp; Carp::croak ("CBOR::XS::as_map only acepts array references with an even number of elements, caught") }; |
798 | |
798 | |
799 | bless [$_[0], 7, undef], CBOR::XS::Tagged:: |
799 | bless [$_[0], 7, undef], CBOR::XS::Tagged:: |
800 | } |
800 | } |
801 | |
801 | |
802 | =head2 OBJECT SERIALISATION |
802 | =head2 OBJECT SERIALISATION |