in reply to pack() format error.

It's because you have numbers above 255 being packed as "C", which is supposed to be for bytes only. Perhaps using "U" will do better?

Update: see, this is why I should click "Submit" right away, instead of being distracted.


Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart