my ($part1, $part2, $part3, $part4) = $line =~ /"some text \((.*?)\) more text (.*?) and dst text (.*?) -flag (.*?)"/; #### $part1 = 6's and 7's $part2 = fred $part3 = joe $part4 = /tmp/filename