in reply to Making two 8-bit numbers from indices of set bits

Dear Monks

I have to admit I don't know mutch about bits and bytes (for me just a $var seem to work pretty well).
So my question is why one should do all this complex stuff. Is it performance or binary socket/file IO ?

Any suggestion about documentation about this subject ?

Thnx
LuCa
  • Comment on Re: Making two 8-bit numbers from indices of set bits

Replies are listed 'Best First'.
Re^2: Making two 8-bit numbers from indices of set bits
by carcassonne (Pilgrim) on Feb 23, 2007 at 12:36 UTC
    The subject is about anything that works with bit fields. Many microcontrollers for instance will use bit fields for various statuses. On the Perl side these have to be packed in binary format and then sent (TCP, serial port, etc...) to the microcontroller.

    In the PC world we do not care anymore about these things since we have so much RAM. We could use 32 32-bit variables to represent 32 booleans and who would complain ? ;-)

    As for info on the subject, I guess you have to have a need to do such operations in the first place. If you want to only experiment and have fun while doing it, you can use a POE TCP server and client and exchange data using the way described here.