in reply to Extracting info

Mail::Internet is a useful module for parsing email messages.

If you don't want the overhead of using modules, you could do something like:

my $from; while (<MAIL>) { my $mail = $_; chomp $mail; next unless substr($mail, 0, 6, '') eq 'From: '; $from = $mail; last; } print "Mail from : $from\n";