my $line = ''; my @fields; while (<>) { $line .= $_; if (/"\n/ or eof) { $line =~ s/^"//; $line =~ s/"$//; @fields = split(/",\s*/); $line = ''; } }