#!/usr/bin/perl use strict; use warnings; while () { chomp; # remove the pesky quotes at the beginning and end s/^"//; s/"$//; # change all doubled quotes into just singles s/""/"/g; print $_ . "\n"; } __DATA__ "" "a""""" "a""b""c""d""f" "This is a ""test""" "Here we have """"a nested set of double-quoted quotes"" or whatever.""" "Harvey ""the Screwdriver"" Ledbetter"