use bigint; my $n = 123456789123456; print $n->as_hex; #### use bigint; print 123456789123456->as_hex