in reply to Net::POP3 and Mail::POP3Client Weirdness - argh!

What about this?

use strict; use Mail::POP3Client; my $pop3 = new Mail::POP3Client(); # default is localhost $pop3->User( "somebody" ); $pop3->Pass( "doublesecret" ); $pop3->Connect() || die "failed: $pop3->Message()\n"; $pop3->Close();
or this:
use strict; use Mail::POP3Client; my $pop3 = new Mail::POP3Client( HOST => 'biztos.com' ); $pop3->User( "somebody" ); $pop3->Pass( "doublesecret" ); $pop3->Connect() || die "failed: $pop3->Message()\n"; $pop3->Close();

Update: I seem to recall having issues with the Connect method. Another thing you might try is:

use strict; use Mail::POP3Client; my $pop3 = new Mail::POP3Client(); # with & without the host $pop3->User( "somebody" ); $pop3->Pass( "doublesecret" ); $pop3->Connect(); if ($pop3->Alive()) { # connection established } else { # no connection } $pop3->Close();

2nd Update: The first two fail for me but the third works. I think that Mail::POP3Client has a bug in the Connect method now.

3rd Update: I downloaded the latest version of Mail::POP3Client from CPAN (AS had a very old version). Now all three work for me.

Replies are listed 'Best First'.
Re: Re: Net::POP3 and Mail::POP3Client Weirdness - argh!
by Anonymous Monk on Jul 14, 2003 at 15:48 UTC
    using any of the above examples where the Connect() is called gives me an Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/Mail/POP3Client.pm line 425 error. Have downloaded and am using the latest from CPAN. HELP Please...

      What version of Mail::POP3Client do you have?
      On Windows: perl -le "eval \"require $ARGV[0]\" and print $ARGV[0]->VERSION" Mail::POP3Client
      On *nix: perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Mail::POP3Client

        The latest version from CPAN ( 1.15 ) I just downloaded and installed. dave_shakespeare@hotmail.com