$a = "word 15,000 word word 20,000"; @b = split " ", $a; $b[1] =~ s/,//g; $b[4] =~ s/,//g; print $b[1] + $b[4]."\n";