in reply to Why doesn't this give an 8 character hex number?

Try doing:
sprintf("%08x", $some_number);
consult 'man printf' for more details
  • Comment on RE: Why doesn't this give an 8 character hex number?