in reply to How to change a part of a line in a text???

I think you're having trouble with escape characters. I broke it down into steps so you can see it plainly. I could have been very clever and given you one regex that would do it but it is easier to see what is going on here.
use strict; use warnings; my $str = "otsort ../mydata/SKE_DE_WKey_out.dat ../mydata/SKE_DE_WKey_ +out.srt /apost s(1001,8,c,a) om(1001,1,c,EQ,' ') f(fix,1371) core(600 +00)"; print "$str\n"; $str =~ s/\/apost s/\"\/apost s/; print "$str\n"; $str =~ s/ om\(/,om\(/; print "$str\n"; $str =~ s/ f\(fix.*/,record(1371)/; print "$str\n";