my $old_INPUT_RECORD_SEPARATOR = $/; $/ = $self->record_delimiter; open (DELIMFILE, '<', $filename) or (Carp::confess("Cannot open file [$filename]: $!")); my $record; while () { chomp; $record = $_; # If a line contains an odd amount of doublequotes ("), then we'll need to continue reading until we find another line that contains an odd amount of doublequotes. # This is in order to catch fields that contain recordseparators (but are encased in ""'s). if (grep ($_ eq '"', split ('', $_)) % 2 == 1) { # Keep reading data and appending to $record until we find another line with an odd number of doublequotes. while () { $record .= $_; if (grep ($_ eq '"', split ('', $_)) % 2 == 1) { last; } } } ## end if (grep ($_ eq '"', split...)) push (@{$ar_returnvalue}, ReadRecord($self, $record)); } ## end while () close (DELIMFILE); $/ = $old_INPUT_RECORD_SEPARATOR;