in reply to pack question



As btrott says, it isn't quite clear what you are after. Perhaps something like this:
print hexdigits(324789), "\n"; sub hexdigits { join " ", map {sprintf "0x%02x", $_} unpack("C*", pack "V", $_ +[0]); } # Prints: 0xb5 0xf4 0x04 0x00
Use pack "V" or "N" as required.

John.
--