in reply to How to retrieve the string after the space???
Hi, You just need to have a small correction in you if condition.
if ($line =~ m/To:/i) { if ($line =~ m/<([^>]+)>/i) {print "<$1>\n"} }
In the above statement, after checking whether the line contains To:, I am using a regex for searching the text within open and close delimiters and printing the searched text within < and >.
|
|---|