do { $line = } until ($line =~ /^From:/i); if ($line =~ /\@my\.university\.edu/i) { ##replace the email bit with whatever you want open (MAIL, "|/usr/sbin/sendmail 3055551212\@mypager.net") || die "Can't open mail program:$!"; $line =~ /(\w+)(.)(.)\@bio/i; print MAIL "From:$1\@$2\.$3\n"; $endhead = 1; while ( $line = ){ if ($line !~ /\w/) {$endhead = 0}; # the above line looks for the blank line separating the body of # the message from the headers, once it sees it, it starts sending # the body in the email print MAIL "$line" unless (($line =~/^>/) || ($endhead)); # the /^>/ looks for text quoted back to me and doesn't send that # to the pager. I don't want to see the drivel I wrote again on # my pager } close (MAIL); }