use Math::BigInt; my $n = Math::BigInt->new( 2 ); $n->bpow( 64 ); printf "%040s\n", $n;