ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CBOR-XS/XS.pm
(Generate patch)

Comparing CBOR-XS/XS.pm (file contents):
Revision 1.79 by root, Fri Dec 11 06:03:40 2020 UTC vs.
Revision 1.80 by root, Fri Dec 11 06:05:33 2020 UTC

766 766
767=item CBOR::XS::as_map [key => value...] 767=item CBOR::XS::as_map [key => value...]
768 768
769Treat the array reference as key value pairs and output a CBOR map. This 769Treat the array reference as key value pairs and output a CBOR map. This
770allows you to generate CBOR maps with arbitrary key types (or, if you 770allows you to generate CBOR maps with arbitrary key types (or, if you
771don't care about semantics, duplicate keys or prairs in a custom order), 771don't care about semantics, duplicate keys or pairs in a custom order),
772which is otherwise hard to do with Perl. 772which is otherwise hard to do with Perl.
773 773
774The single argument must be an array reference with an even number of 774The single argument must be an array reference with an even number of
775elements. 775elements.
776
777Note that only the reference to the array is copied, the array itself is
778not. Modifications done to the array before calling an encoding fuinction
779will be reflected in the encoded output.
776 780
777Example: encode a CBOR map with a string and an integer as keys. 781Example: encode a CBOR map with a string and an integer as keys.
778 782
779 encode_cbor CBOR::XS::as_map [string => "value", 5 => "value"] 783 encode_cbor CBOR::XS::as_map [string => "value", 5 => "value"]
780 784

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines