in reply to How to retrieve the string after the space???
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
|
|---|