Thanks for the replies. Here is the code I am using. I'm not too familiar with Perl so I really have no idea where I am going wrong. The output I get is just a warning about "main::trigger" only being used once. I've tried using the sample code you've posted and it doesn't work. I try to use the print $pop->Count(); in that sample code and it spits out -1, meaning it's not seeing any email. Any further suggestions? Thanks for the help.
$continue = "false"; until ($continue = "true") { use Mail::POP3Client; $pop = new Mail::POP3Client( USER => "me", PASSWORD => "password", HOST => "pop.google.com", AUTH_MODE => "PASS", DEBUG => 1 ); $MailState = $pop->State; if($MailState eq 'AUTHORIZATION') { die "\n\nBad user name or password!\n" } elsif($MailState eq 'DEAD') { die "\n\nMail server unreachable or unavailable!\n" } $messages = $pop->Count(); print $messages; if ($messages > 0) { # Read mail headers and get useful info for ($m = 1; $m<=$pop->Count; $m++) { $Headers = $pop->Head($m); if($Headers =~ /(\bReturn-Path.*)/g){ $RTNP = $1}else{ $RTNP = 'Return-Path:'} if($Headers =~ /(\bDate.*)/g){ $Date = $1}else{ $Date = 'Date:'} if($Headers =~ /(\bFrom.*)/g){ $From = $1}else{$From = 'From:'} if($Headers =~ /(\bTo.*)/g){ $To = $1}else{ $To = 'To:'} if($Headers =~ /(\bSubject.*)/g){ $Subj = $1}else{ $Subj = 'Subject:'} # Now Print it print "Message: ", $m, "\n", #$Date,"\n", #$To,"\n", #$From,"\n", #$RTNP, "\n", $Subj,"\n\n"; if ($Subj =~ /\bswift\sburst\alert.*/i) { $trigger = $m; $continue = "true"; } } } } #Look at the body of that email and do whatever with it... #$Headers = $mail->Head($trigger); #@_ = split(/\n/, $Headers); #$Body = $mail->Body($trigger); #print "\n\nMessage: ", $trigger, "\n\n"; #print $Body; #$pop->Close();

Edit g0n - added code tags


In reply to Re^2: Mail::POP3Client email server to use by austinz
in thread Mail::POP3Client email server to use by austinz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.