use Math::BigInt; # or make it faster: install (optional) Math::BigInt::GMP # and always use (it will fall back to pure Perl if the # GMP library is not installed): use Math::BigInt lib => 'GMP'; my $str = '1234567890'; $x = Math::BigInt->new($str); # defaults to 0 $y = $x->copy(); # make a true copy $x->badd($y); # addition (add $y to $x) $x->bsub($y); # subtraction (subtract $y from $x) $x->bstr(); # convert to a normalized string $x->bsstr(); # normalized string in scientific notation $x->as_hex(); # as signed hexadecimal string with prefixed 0x $x->as_bin(); # as signed binary string with prefixed 0b # etc.