# convert double-quotes to single-quotes if( $$quote && $text =~ s/"/''/s ){ $$quote = 0; } while ($text =~ s/"([^"]*)"/``$1''/sg) {}; $$quote = 1 if $text =~ s/"/``/s;