my $dec = hex('FF0000000000'); printf("%012x", $dec); __END__ Integer overflow in hexadecimal number at !.pl line 1 0000ffffffff