Perl 5.8.8 on Linux RHEL 5.5.56

Basically my Perl program has to read all emails in a POP3 mailbox, and save all attachments to a hardcoded subdir, process them with a Perl program, and send an SMTP email out telling the user of success or failure (SMTP part works). But I also need plain authentication no SSL or TLS. I do care about the message body, because the same email address may have to be used for multiple Perl programs (from multiple inputs/departments), so I may have to process the body looking for commands I define, to tell me which program to run no the attached file.

I just installed Net::POP3 2.31 on Jun 30. I can retrieve my first message from my email account fine, when I get to the second message (message number 2) I get this error in the get() method:

main::getnetpop3(conv.pl:627):      $msgsize=$conn->list($msgnum); # Get one msg size, in bytes?
  DB<8> n                                                                                    
Use of uninitialized value in numeric eq (==) at /usr/lib/perl5/5.8.8/Net/POP3.pm line 311.
at /usr/lib/perl5/5.8.8/Net/POP3.pm line 311
        Net::POP3::_LIST('Net::POP3=GLOB(0xa99bb50)', 2) called at /usr/lib/perl5/5.8.8/Net/POP3.pm line 202
        Net::POP3::list('Net::POP3=GLOB(0xa99bb50)', 2) called at conv.pl line 627
        main::getnetpop3() called at conv.pl line 164
main::getnetpop3(conv.pl:628):      $headers=$conn->top($msgnum); # Returns ref to array.

I'm not familiar with this module nor do I do module programming. Basically I cannot get any msg but the first.

Anyone know how to fix the error?

I'll try to contact the author but the last copyright date is 2003. His email address may not be valid: Graham Barr <gbarr@pobox.com>

Thanks.

P.S. If you have another good example of accessing a POP3 email account and saving attachments (XLS files) then I can try that. But I'm still new to doing POP3 via Perl so a clear example is what I'm looking for. I tend to learn by looking at the full code. I do need a POP3 module that supports auth though, but not SSL or TSL.


In reply to Error in Net::POP3 by bulrush

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.