… | |
… | |
184 | object instance. The serialiser is then supposed to encode the class name |
184 | object instance. The serialiser is then supposed to encode the class name |
185 | and all of these return values (which must be encodable in the format) |
185 | and all of these return values (which must be encodable in the format) |
186 | using the relevant form for perl objects. In CBOR for example, there is a |
186 | using the relevant form for perl objects. In CBOR for example, there is a |
187 | registered tag number for encoded perl objects. |
187 | registered tag number for encoded perl objects. |
188 | |
188 | |
|
|
189 | The values that C<FREEZE> returns must be serialisable with the serialiser |
|
|
190 | that calls it. Therefore, it is recommended to use simple types such as |
|
|
191 | strings and numbers, and maybe array references and hashes (basically, the |
|
|
192 | JSON data model). You can always use a more complex format for a specific |
|
|
193 | serialiser by checking the second argument. |
|
|
194 | |
189 | =head2 DECODING |
195 | =head2 DECODING |
190 | |
196 | |
191 | When the decoder then encounters such an encoded perl object, it should |
197 | When the decoder then encounters such an encoded perl object, it should |
192 | look up the C<THAW> method on the stored classname, and invoke it with the |
198 | look up the C<THAW> method on the stored classname, and invoke it with the |
193 | classname, the constant string to identify the format, and all the return |
199 | classname, the constant string to identify the format, and all the return |