in reply to Data munging - in, out and something in between

Whether Perl converts the number to a floating point number internally doesn't matter. The number will automatically get converted back into an integer. Decimals will be lost, of course.

$p = 'ABCD'; $n = unpack('N', $p); print("$n\n"); # 1094861636 $n *= 1/3; print("$n\n"); # 364953878.666667 $p = pack('N', $n); $n = unpack('N', $p); print("$n\n"); # 364953878

The two most likely causes in my mind are 1) that you're trying to store a number too big for the field into which it's being packed, or 2) that you didn't binmode the file from which you are reading or to which you are writing.

We can best help you if you show us a bit of code that reproduces the problem. Be sure to specify what output you are getting and what output you are expecting.