in reply to Explanation of pack
What many of the pack formats involve is different representations of numbers. Your "signed char" is an example of these. Some of these types are specific sizes (which translates to fixed numeric ranges). Where it says in the "perldoc -f pack" document that something is exactly so many bits, these are fixed sizes:<bl>
Other pack formats deal with other kinds of encodings for numbers, or representations of strings. These, again, are typically found in files or in network packets.
Unless you're dealing with external files or network protocols that use binary or other non-text representation of data, you shouldn't need to bother with pack
But it's quite useful when you need it, like any power tool. For instance, I couldn't have written Archive::Zip nearly as fast without it, because the zip file format has fixed binary headers.
|
|---|