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.
--


In reply to Re: pack question by jmcnamara
in thread pack question by dash2

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":