$_ = "Goodbye\\; Good luck\\, and thanks for all the fish!\\\n\\\n"; print "<$_>\n"; s/\\([;,\n])/$+/g; # Does work print "<$_>\n";