The answer to this sort of question is not that straightforward. If you use a 32-bit perl, your values start out as an IV (integer value), so you might think the maximum is 2**31-1. If you however add one to that, the value will become an UV (unsigned integer value), and you might think the maxiumum is 2**32-1. However, when you add 1 to that, the value becomes a NV (float value). That one has a very high
maximum value, but that one is in fact irrelevant because long before that point you lose resolution and adding 1 will not change the value anymore. That typically happens somewhere around 9e15 (depends on the exact float resolution on your system). Still, this should be way beyond any foreseeable number of transactions unless you do millions of them per second (though if you need a string representation you may have to use (s)printf in order to get all significant digits).
Conclusion: normally you simply don't have to worry about integer overflow of a counter at the perl end.
If you need even more digits (or don't want to bother with (s)printf for big values), simply use an integer in string form and use ++, which will then be magic and have
no restriction whatsoever, e.g.:
perl -wle '$a = "9" x 100; $a++; print $a'
will give you 1 folowed by 100 zeros