I have an application that requires me to write normal string data or a 
number into a binary file. For example, if I have the string "ff", I 
want to write the byte FF to the output file. If I have the number 1, I 
want to write the byte 01 to the output file.

I have been using the pack function with either "c","C",or "H2" 
templates. I figured out early on that "c" is expecting a number and 
"H2" is expecting two valid hexadecimal digits (0-9,a-f).

My question is this: what is the difference between "c" and "C"? I know 
what perldoc says - one is a signed char and the other is an unsigned 
char. So if I have the value 230, shouldn't that be illegal for a signed 
8-bit number, since the valid range is -127 to 128. I tried every value 
between 0 and 255 and there is no difference between "c" and "C".

Also, off-topic, can anyone recommend a solid binary file editor that 
runs in UNIX? I have been using HexEdit for Windows and I would prefer 
to run only in UNIX.

Thanks,

E.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to