djc2
asked on
can I output integer data in binary form rather than ASCII?
I am processing some data with perl. I need to output my integer data in 2-byte signed (i.e., -32768 to +32768) binary format rather than standard ascii text format. [i.e., analogous to outputing data with the write() C-language command available from unistd.h]. I don't want to have any end-of-line characters between each integer value. Is there a way to do this in perl?
Thanks, Dave
Thanks, Dave
ASKER
OK that works ... I guess it wasn't as difficult a question as I thought. Thanks. So how do I give you a grade?
What grade do you want to give?
ASKER
So whether or not you tell me how to give you a grade depends on what the grade is, huh? (just kidding) ... A
In the past I thought that I was always given the option to give a grade. Has the system changed?
In the past I thought that I was always given the option to give a grade. Has the system changed?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK, thanks.
You're welcome.
perldoc -f pack
should tell you about other pack/unpack formats that may be useful
perldoc -f pack
should tell you about other pack/unpack formats that may be useful
pack('n',32768) #a short in "network" (big-endian) order
pack('v',32768) #a short in "VAX" (little endian) order