On Tue, 19 Sep 2000, Dave Storrs wrote:

>       "Unpack takes binary data in some particular format and
> disassembles it, assigning various pieces of it to variables according to
> formatting that you supply.  Pack does the opposite, using your supplied
> formatting to crunch Perl scalar variables into binary data that is
> represented in some specific way.  The binary data used by (un)pack will
> belong to exactly one type of C numeric variable, meaning that it will be
> limited in what kinds of numbers it can store and how it will represent
> them."
> 
>       Is this definition completely off-base?

You were doing fine until the last sentence.  I'm not 100% sure what it
means but I'm pretty sure its not right.  pack() and unpack() do a lot
more than just C numerics - they do Unicode, network byte ordering, hex
strings, simple compression and null packing.

I wouldn't suggest that every Perl geek should know pack() and unpack().  
Still, when you need it you'll be glad its there.

-sam


Reply via email to