http://www.perlmonks.org?node_id=1046123


in reply to Re: One liner to subtract by 2
in thread One liner to subtract by 2

You'll lose leading zeros with that.

-derby

update: so perl -pe 's/([0-9]{10})$/sprintf("%010d", $1-2)/e'