in reply to How do I write the value of a scalar integer as a Binary value, not a string?

Well, once you figure out whether you want it to be big-endian or little-endian, you can use pack to do the job.
  • Comment on Re: How do I write the value of a scalar integer as a Binary value, not a string?