use Mail::POP3Client; $pop = new Mail::POP3Client( USER => "me", PASSWORD => "mypassword", HOST => "pop3.do.main" ); my $specific_email_subject = "Parse by script"; my $parser_script = "email_parse.pl"; for ($i = 1; $i <= $pop->Count(); $i++) { foreach ( $pop->Head($i) ) { if (/^Subject:\s+($specific_email_subject)/i) { # Special email detected!!! # open a 'pipe' to the script that will parse/process # this email message body. open(PARSER,">$parser_script |"); # send email body to the script (will receive # it via STDIN print PARSER $pop->Body($i); # close pipe (end 'transmission') close(PARSER); } } }