#!/usr/bin/env perl
use warnings;
use 5.012;
my $var = 1 << 31;
say unpack( "B*", pack( "N", $var ) );
# 10000000000000000000000000000000
How can I get with pack/unpack from
my $var = 1 << 63;
an output like this?
# 1000000000000000000000000000000000000000000000000000000000000000
The
>forces big-endian byte-order on theQ(unsigned 64-bit “quad”) type.