It is good to know that pack works. I don't need to dump the binary RGB key to one file and the count data to another file and write a c program to merge them! Perl stores its ints at type j/J rather than binary. I have been doing too much C!!! Maybe I can spend a few more hour and figure out how to UNPACK a binary blob into a string of 1s and 0s. Just to make sure I am on the right page here... $count=17767; # C=0x4567=Dec17757 $c16 = pack("S", $count); # Pack COUNT to uint16 $ctest = unpack('S', $c16); # Pull it back out??? printf("C=$count = %x, CT=$ctest = %x\n", $count, $ctest); -> Running C:\bin\bb.pl Sat Aug 15 01:42:41 2015 C=17767 = 4567, CT=17767 = 4567 Holy Guacamole! The Pack is Back!! Thanks 1E6 or 11110100001001000000 :)
In reply to Re^2: Pack number to unsigned short (printf)
by BrianP
in thread Pack number to unsigned short
by BrianP
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |