This makes the following changes: 1. looks_like_sereal() and decode_sereal() now share magic string validation logic. 2. protocol v1 and v2 require the old SRL_MAGIC_STRING magic header (or else old decoders could not decode "new" protocol v1 output) 3. protocol v3 and later require the new SRL_MAGIC_STRING_HIGHBIT header 4. looks_like_sereal() now returns the version of the document if it is believed to be Sereal, returns the number 0 when the document looks like it is utf8 encoded, and returns perl FALSE (PL_sv_no) when the document does not look like Sereal at all. 5. Changes the error message when trying to decode a document which does not look like Sereal. 6. Renames SRL_MAGIC_STRING_LILIPUTIAN to SRL_MAGIC_STRING_UINT_LE, the old name was a bit silly.
Perl has a canoncial undef, which needs to be treated separately from an undefined variable for certain edge case round trips. This adds a new tag SV_UNDEF to handle this.
Make sure to compare against the logic for CBOR hooks which is sufficiently generic to serve multiple serializers. Right now, the only incompatibility is that for Sereal, FREEZE needs to return a single data structure instead of a list. That is quite a bit more efficient for simple data structures and also easier on the implementation, particularly for more static languages than Perl. Comments welcome. This is a proposal.
In other words, non-incremental Snappy compression is no longer valid Sereal in protocol version 2.
By using =item for long sections we don't get those things included in TOC's on e.g. metacpan.org. Just make them =head* instead, mostly =head3's. I'm fairly sure I got the intended heading level in sereal_spec.pod right, but it's possible that I didn't.