Use pack "V" or "N" as required.print hexdigits(324789), "\n"; sub hexdigits { join " ", map {sprintf "0x%02x", $_} unpack("C*", pack "V", $_ +[0]); } # Prints: 0xb5 0xf4 0x04 0x00
In reply to Re: pack question
by jmcnamara
in thread pack question
by dash2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |