print unpack 'H*', pack 'Q>', 654848;; 000000000009fe00 ## With a Perl that doesn't support 64-bit ints (Q). ## Corrected &.v.% per ikegami++ print unpack 'H*', pack 'NN', int( $n / 2**32 ), $n % 0xffffffff;; 000000000009fe00