my ($from) = $line =~ /from=<(.*?)>/; my ($to) = $line =~ /to=<(.*?)>/; print $from, "::", $to;