.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Sereal 3pm" .TH Sereal 3pm "2020-08-03" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Sereal \- Fast, compact, powerful binary (de\-)serialization .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& use Sereal qw( \& get_sereal_decoder \& get_sereal_encoder \& clear_sereal_object_cache \& \& encode_sereal \& decode_sereal \& \& read_sereal \& read_sereal_file \& write_sereal \& write_sereal_file \& \& looks_like_sereal \& scalar_looks_like_sereal \& \& sereal_encode_with_object \& sereal_decode_with_object \& decode_sereal_with_header_data \& \& sereal_decode_with_header_with_object \& sereal_decode_only_header_with_object \& sereal_decode_only_header_with_offset_with_object \& sereal_decode_with_header_and_offset_with_object \& sereal_decode_with_offset_with_object \& \& SRL_UNCOMPRESSED \& SRL_SNAPPY \& SRL_ZLIB \& SRL_ZSTD \& ); \& # Note: For performance reasons, you should prefer the OO interface, \& # or sereal_(en|de)code_with_object over the stateless \& # encode_sereal/decode_sereal functions. \& # See the Sereal::Performance documentation for details. .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fISereal\fR is an efficient, compact-output, binary and feature-rich serialization protocol. The Perl encoder is implemented as the Sereal::Encoder module, the Perl decoder correspondingly as Sereal::Decoder. They are distributed separately to allow for safe upgrading without downtime. (Hint: Upgrade the decoder everywhere first, then the encoder.) .PP This \f(CW\*(C`Sereal\*(C'\fR module is a very thin wrapper around both \f(CW\*(C`Sereal::Encoder\*(C'\fR and \f(CW\*(C`Sereal::Decoder\*(C'\fR. It depends on both and loads both. So if you have a user of both encoder and decoder, it is enough to depend on a particular version of \f(CW\*(C`Sereal\*(C'\fR and you'll get the most recent released versions of \f(CW\*(C`Sereal::Encoder\*(C'\fR and \f(CW\*(C`Sereal::Decoder\*(C'\fR whose version is smaller than or equal to the version of \f(CW\*(C`Sereal\*(C'\fR you depend on. .PP The protocol specification and many other bits of documentation can be found in the github repository. Right now, the specification is at , there is a discussion of the design objectives in , and the output of our benchmarks can be seen at . .SS "\s-1EXPORTED FUNCTIONS\s0" .IX Subsection "EXPORTED FUNCTIONS" It is recommended to use the object-oriented interface of \&\f(CW\*(C`Sereal::Encoder\*(C'\fR and \f(CW\*(C`Sereal::Decoder\*(C'\fR if you care about performance. For detailed performance considerations, see Sereal::Performance. .PP You can optionally import five functions from \f(CW\*(C`Sereal\*(C'\fR. \&\f(CW\*(C`encode_sereal\*(C'\fR is the same function as Sereal::Encoder's \&\f(CW\*(C`encode_sereal\*(C'\fR function. \f(CW\*(C`decode_sereal\*(C'\fR and \f(CW\*(C`looks_like_sereal\*(C'\fR are the same as Sereal::Decoder's functions of the same names. Finally, you can import the advanced functional interface \&\f(CW\*(C`sereal_encode_with_object\*(C'\fR and \f(CW\*(C`sereal_decode_with_object\*(C'\fR. Again, see Sereal::Performance for information about those. .PP After loading the \f(CW\*(C`Sereal\*(C'\fR module, both \f(CW\*(C`Sereal::Encoder\*(C'\fR and \&\f(CW\*(C`Sereal::Decoder\*(C'\fR are guaranteed to be loaded, so you can use their object-oriented interface. .SS "get_sereal_encoder($OPTSHASH)" .IX Subsection "get_sereal_encoder($OPTSHASH)" Returns a Sereal::Encoder with the given options. This encoder will be shared by other calls to this function. .SS "get_sereal_decoder($OPTSHASH)" .IX Subsection "get_sereal_decoder($OPTSHASH)" Returns a Sereal::Decoder with the given options. This encoder will be shared by other calls to this function. .SS "clear_sereal_object_cache" .IX Subsection "clear_sereal_object_cache" Clears cache of objects created via \fBget_sereal_encoder()\fR and \fBget_sereal_decoder()\fR. Returns the number of objects that were removed from the cache (the sum of both types). .SS "write_sereal_file($FILENAME,$STRUCT,$APPEND,$OPTS)" .IX Subsection "write_sereal_file($FILENAME,$STRUCT,$APPEND,$OPTS)" Write a sereal packet to \f(CW$FILENAME\fR. See \fBSereal::Encoder::encode_to_file()\fR. .SS "write_sereal($FILENAME,$STRUCT,$APPEND,$OPTS)" .IX Subsection "write_sereal($FILENAME,$STRUCT,$APPEND,$OPTS)" alias for \fBwrite_sereal_file()\fR .SS "read_sereal_file($FILENAME,$OPTS,$ROOT)" .IX Subsection "read_sereal_file($FILENAME,$OPTS,$ROOT)" Read a sereal packet from a file. See \fBSereal::Decoder::decode_from_file()\fR. .SS "read_sereal($FILENAME,$OPTS,$ROOT)" .IX Subsection "read_sereal($FILENAME,$OPTS,$ROOT)" alias for \fBread_sereal_file()\fR .SH "BUGS, CONTACT AND SUPPORT" .IX Header "BUGS, CONTACT AND SUPPORT" For reporting bugs, please use the github bug tracker at . .PP For support and discussion of Sereal, there are two Google Groups: .PP Announcements around Sereal (extremely low volume): .PP Sereal development list: .SH "AUTHOR" .IX Header "AUTHOR" Steffen Mueller .SH "ACKNOWLEDGMENT" .IX Header "ACKNOWLEDGMENT" This module was originally developed for Booking.com. With approval from Booking.com, this module was generalized and published on \s-1CPAN,\s0 for which the authors would like to express their gratitude. .SH "LICENSE" .IX Header "LICENSE" This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2012, 2013, 2014 by Steffen Mueller