$foo=~s/\"/\\\"/g; [download]
In reply to I am having a problem with search and replace regarding " by Anonymous Monk