while () { chomp; print "$1\n" while m/(".*?(?:"|$))/g; } __DATA__ abc "def "ghi" jkl" mno"pqr"stu v"wx"y"z"