use Text::ParseWords; @list = "ewords ('\s+', 0, $input); foreach $item (@list) { ; }