Add the tests I initially meant to add to t/400_evil.t. We should also document that the warn_unknown option only does what you mean if we encounter an unknown object AND *that* can't be serialized and *that* object has a string overload. It does not work for cases like what I'm doing with Blessed::Sub::With::Lazy::Overload where we actually have a blesser ArrayRef that has an overload that calls a subroutine that's one its array elements. So Sereal can't be used to emulate the idiom of having an object with a STORABLE_freeze method. Ways to deal with porting code like that include: 1. Having a pre-processor that walks the structure you're wanting to Serialize and call every STORABLE_freeze on objects that ->can("STORABLE_freeze") (ew!) 2. Having something similar except try to stringify objects you encounter, checking if the stringified output looks different from something that doesn't have an overload, and if so keep that (even more ew!) 3. Implement something like SEREAL_freeze in Sereal::Encoder itself (mega ew!) 4. Do that except have a callback mechanism for specific types, say objects, pretty much what you get with #2 except Sereal would support it. This sucks even more, better to just make it another module. 5. Just emit errors on stuff we can't serialize and make damn sure we don't have objects whose blessed structures contain a sub that'll be called on stringification. For migration purposes you could try to encode with Sereal but fallback to Storable if you can't encode something.
I kept looking through the docs trying to figure out what the default of these options was, clarify that explicitly in the docs.
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.
When trying to stringify an unknown data structure, the encoder had a bug in the backtracking that would cause output corruption for refcounts > 1. Solution: Avoid tracking refs that we don't want to refer to using REFP/ALIAS.
ref_rewrite_pos used to be a copy of the pos pointer into the buffer. Alas, that would turn out to be a nasty, nasty problem if you realloc the buffer and then restore pos from ref_rewrite_pos to point outside the buffer. Fix: ref_rewrite_pos is now an offset into the buffer.