I have had success now using Mail::MboxParser for all my basic mail parsing needs, like getting subject, from, to. Now bossman wants me to do more extensive regex filtering and grabbing weird data in the email body.
I wrote a little test script, shown below. I am able to get the "appointment date" data, contained in the message body, that I am looking for, but only for the first record. The while loop keeps looping back to that record. Also, I cannot get to the next line that has the "comments section" for each email. I know this has got to be something stupid I am not seeing, but after looking at this for so long, everything is starting to blur together. Would anyone have any insight as to my mistake? Thanks, Joan #!/usr/bin/perl use Mail::MboxParser; my $mb=Mail::MboxParser->new('MyMailbox', decode => 'ALL'); #grab data from the body of the message while (my $msg = $mb->next_message) { $test = $msg->body($msg->find_body) ; while (defined($_=$test)) { if ($test =~ /App:.*Date:\s+(.{0,8})\s+Time:/) { #looking for appointment data here print "I see the appointment date is $1", "\n"; } elsif ($test =~ /Comments/) { while (($test=<>) !~ /(Notification|XEDB)/) { $comments .= $_; chop($comments); $comments .= " "; print "The comments are", $comments; }#end while ($test=<>) }#end elsif }#end while (defined($_=$test)) { }#while (my $msg = $mb->next_message) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]