in reply to quote in perl command line

you need to declare double quotes in your $_ variable...

try:

$_ =~ s|\"|\\"|g;