Problems when using Mail::POP3Client module

P

Paul

hi, greetings,

I am trying to use Mail::pOP3Client to set up a script for my gmail
accout,following is my test script,

use Mail::pOP3Client;
use strict;
use warnings;

my $pop;
my $i;

$pop = Mail::pOP3Client->new(USER => "myname",
PASSWORD => "myPWD",
HOST => "pop.gmail.com",
USESSL => 1);
for( $i = 1; $i <= $pop->Count(); $i++ ) {
foreach( $pop->Head( $i ) ) {
/^(From|Subject):\s+/i && print $_, "\n";
}
}
$pop->Close();


This is the error I got:
Can't locate object method "new" via package "IO::Socket::SSL" at
/usr/lib/perl5/site_perl/5.8/Mail/POP3Client.pm line 369.

I am using Cygwin on WinXP, and have installed Mail::pOP3Client module
without any problems.

Do I need to install other modules? Thanks for your reply.

paul
 
A

A. Sinan Unur

I am trying to use Mail::pOP3Client to set up a script for my gmail
accout,following is my test script,
....

This is the error I got:
Can't locate object method "new" via package "IO::Socket::SSL" at
/usr/lib/perl5/site_perl/5.8/Mail/POP3Client.pm line 369.

Well, uhm, do you have IO::Socket::SSL installed?

Sinan
 
S

Sisyphus

Paul said:
yes. I checked it again. Maybe I need reinstall all the libraries.
Thanks.

Or don't specify the use of SSL .... but only if security is *not* an issue,
of course.

Cheers,
Rob
 
A

A. Sinan Unur

Or don't specify the use of SSL .... but only if security is *not* an
issue, of course.

Or, use stunnel ... but that's a non-Perl solution.

Seriously, though, I looked at Mail::pOP3Client, and noticed, in the
Connect method:

if ( $me->{USESSL} ) {
if ( $me->Port() == 110 ) { $me->Port( 995 ); }
eval {
require IO::Socket::SSL;
};

The code does not check $@ after the eval. IMHO, that is bug. In the
short term, the OP could add

die $@ if $@;

after the eval to get a little more information.


Sinan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,172
Messages
2,570,934
Members
47,474
Latest member
AntoniaDea

Latest Threads

Top