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 >.
In reply to Re: How to retrieve the string after the space???
by rsriram
in thread How to retrieve the string after the space???
by sam_0056
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |