http://qs321.pair.com?node_id=11118652


in reply to Reliably parsing an integer

What the string is: 99999999999999999999 Value of $strAsInteger: 1e+20 How printf sees it: 18446744073709551615
The results are puzzling.

Perl automatically upgrades large integers to floating point.

Perl's maximum values for integers can be determined as I showed in this post.

If you want to work with integers larger than that, use Math::BigInt.

To validate number formats, use Regexp::Common::number.

Update: If two integers are the same length (or are zero-padded to be the same length), Perl's string comparisons can be used.