#strip LF from line chomp $line; # delete the very first and last " from line for ($line) { s/^\s*"//; s/"\s*$//; } # now split @fields = split /"\s*,\s*"/, $line; # now you should have the pieces I mentioned above