64 Bit "network" (big-endian) order Integer in Perl

perl

Solution

If your system supports the `Q` pack format, you can use `Q>` to get big-endian (since Perl 5.9.2):

% perl -e 'print pack("Q>", 1)' | hexdump -C
00000000  00 00 00 00 00 00 00 01                           |........|

Problem

Similar to how you can use pack's: ``` N An unsigned long (32-bit) in "network" (big-endian) order. ``` Is there any method for packing a 64-bit integer in "network" (big-endian) order in Perl?

Original source

Related problems