use Text::ParseWords; my $line = q(a,b,"hey, you","str1, str2, str3",end); @words = "ewords(',', 0, $line);