if ($line =~ m/To:/i) { ($header,$to) = split(/ /,$line); print "To is: $to\n"; }