s{(".*?")}{ my $s = $1; $s =~ s/,/-/g; $s }ge #### my $in = 0; s{(")|,}{ if($1){ $in= !$in; $1 }elsif($in){ '-' }else{ ',' } }ge