Embed presentation
Download as KEY, PPTX






















































Pack and unpack can be used to serialize and deserialize binary data in Perl. Pack works like sprintf but for bytes, allowing data to be converted to binary formats. Unpack is similar to sscanf but for bytes, and can parse binary data into Perl variables. Examples shown include packing a number into 4 bytes, unpacking those bytes back into a number, and using pack and unpack to serialize and deserialize arrays of data. Advanced techniques discussed include thinking like a C programmer in how data is laid out in memory, using serialization tricks for efficiency, and lazily parsing large amounts of binary data.




















































