>perl -wMstrict -le "my $addend = 0; my $test = 'abc1 abc1 abc1 abc1 abc1'; $test =~ s/(1)/$addend++ + $1/eg; print $test; " abc1 abc2 abc3 abc4 abc5