Looks like you're parsing email messages. Have you considered using Email::Simple?
Alternatively, you could change your code to something like this (untested):
if ($line =~ m/^To:\s+(\S+)/i) { $to = $1; print "To is: $to\n"; }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: How to retrieve the string after the space???
by davorg
in thread How to retrieve the string after the space???
by sam_0056
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |