http://www.perlmonks.org?node_id=50322


in reply to How do I surround commas with escaped double-quotes?

$string= "This, that, and those"; $string =~ s/,/\\",\\"/g; print $string;
Prints:
This\",\" that\",\" and those