Thanks for your reply.
I have another query in regexp, I have some digits for eg 20 40 60 and then I add 40 so finally my output becomes 60 80 100.
Instead of taking the digits as a whole, I would like to add the values separately for each digits. eg: 20+10 40+30 6020 and my output should be30 70 40.
How do I read the digits separately and then then add the values.
Ramesh
Take out three numbers separately in regex through grouping and do the addition.

while (<IN>) {

s/(\d+)(\s+)(\d+)\s+(\d+)/ ($1+10).$2. ($3+30).$2.($420)/ge;

print OUT;

}

The space(s) in between numbers (captured in $2) are appended to the resulting output.