in reply to packing a string into binary

I am writing a perl interface to a proprietary network protocol. I need to be able to take a string and write this to the output stream as a one byte character string.

I trust you realize the futility of trying to pack more than 8 bits of data into 8 bits.

Your example shows a 6 character string. By what unstated magic do you expect that pack will be able to reduce that string to 1 byte without data loss? Even if those 6 characters represent a hex string, it will reduce to 3 bytes.

Replies are listed 'Best First'.
Re: Re: packing a string into binary
by Anonymous Monk on Dec 11, 2001 at 10:30 UTC
    My mistake... After reading your response, I realized I misread one of the components of the specification and didn't really have an issue at all... time to take a break... Humbly,