--- CBOR-XS/doc/indirection.pod 2013/11/26 09:43:39 1.1 +++ CBOR-XS/doc/indirection.pod 2013/11/28 10:16:50 1.2 @@ -46,5 +46,27 @@ =head1 EXAMPLES - +The following Perl data structure is an array containing a reference to an +array, followed by a reference to a string: + + [[], \"string"] + +Since Perl cannot have "naked" arrays or maps inside another data +structure, but only a reference to it, the natural encoding of this +data structure uses a normal array for the array-reference (i.e. it +omits the reference). The string reference is uncommon but valid, and +not the natural way to store a string inside another data structure. An +encoder might therefore chose to encode this string reference using the +indirection tag: + + 256([[], 22098("string")]) + + d9 0100 # tag(256) + 82 # array(2) + 80 # array(0) + d9 5652 # tag(22098) + 66 # text(6) + 737472696e67 # "string" + +