in reply to Removing leading zeros

I'd do it with a regex like:

s/^0+//g



FouRPlaY
Learning Perl or Going To die() Trying

Replies are listed 'Best First'.
Re^2: Removing leading zeros
by Anonymous Monk on Apr 22, 2019 at 15:07 UTC
    That RE fails multiple edge cases. It will change "0", or "00", etc. into "" making it non-numeric. And not handling the negative case has already been mentioned.