#!/usr/bin/perl use strict; use warnings; my $data = do { local $/ = undef; }; my @fields = $data =~ /"(.*?)",\s+"(.*?)",\s+"(.*)",\s+"(.*?)",\s+"(.*?)"/s; print "RESULTS:\n"; print ":$_:\n" for @fields; __DATA__ "data", "moredata", "the notes field "with unescaped quotes" and lets have a hard return in here in a few places, and while we're having fun with that, why not have some "random, commas too!", "lots more data", "lastfield in the record"