#!/usr/bin/perl -w use strict; =doc stuff,"more","foo (1994 "bar" only)",1234,1988,3.0,"" should be: stuff,"more","foo (1994 ""bar"" only)",1234,1988,3.0,"" or could also be: stuff,more,foo (1994 "bar" only),1234,1988,3.0,"" =cut my $x = 'stuff,"more","foo (1994 "bar" only)",1234,1988,3.0,""'; $x =~ s/ "/ ""/g; $x =~ s/" /"" /g; print $x; # prints: # stuff,"more","foo (1994 ""bar"" only)",1234,1988,3.0,""