Your real speed loss is going to be from the spawning of a new process via the backticks, not the actual number conversion. As blazar also noted, you can use Math::BigInt within the scope of a specific block. So something like this will work (and this could easily be put in a loop):