… | |
… | |
108 | object instance. The serialiser is then supposed to encode the class |
108 | object instance. The serialiser is then supposed to encode the class |
109 | name and all of these return values (which must be encodable in the |
109 | name and all of these return values (which must be encodable in the |
110 | format) using the relevant form for perl objects. In CBOR for example, |
110 | format) using the relevant form for perl objects. In CBOR for example, |
111 | there is a registered tag number for encoded perl objects. |
111 | there is a registered tag number for encoded perl objects. |
112 | |
112 | |
|
|
113 | The values that "FREEZE" returns must be serialisable with the |
|
|
114 | serialiser that calls it. Therefore, it is recommended to use simple |
|
|
115 | types such as strings and numbers, and maybe array references and hashes |
|
|
116 | (basically, the JSON data model). You can always use a more complex |
|
|
117 | format for a specific serialiser by checking the second argument. |
|
|
118 | |
113 | DECODING |
119 | DECODING |
114 | When the decoder then encounters such an encoded perl object, it should |
120 | When the decoder then encounters such an encoded perl object, it should |
115 | look up the "THAW" method on the stored classname, and invoke it with |
121 | look up the "THAW" method on the stored classname, and invoke it with |
116 | the classname, the constant string to identify the format, and all the |
122 | the classname, the constant string to identify the format, and all the |
117 | return values returned by "FREEZE". |
123 | return values returned by "FREEZE". |