perl -MCGI -i -e 'while(<>){s!(\d+)!$t=$1+1!e;print}print CGI->new->header,$t' c