diff options
-rw-r--r-- | Net/Cmd.pm | 4 | ||||
-rw-r--r-- | Net/POP3.pm | 9 |
2 files changed, 8 insertions, 5 deletions
@@ -13,7 +13,7 @@ use strict; use vars qw(@ISA @EXPORT $VERSION); use Carp; -$VERSION = "2.10"; +$VERSION = "2.11"; @ISA = qw(Exporter); @EXPORT = qw(CMD_INFO CMD_OK CMD_MORE CMD_REJECT CMD_ERROR CMD_PENDING); @@ -314,7 +314,7 @@ sub read_until_dot while(1) { - my $str = $cmd->getline(); + my $str = $cmd->getline() or return undef; $cmd->debug_print(0,$str) if ($cmd->debug & 4); diff --git a/Net/POP3.pm b/Net/POP3.pm index 41c9f94..8d7c055 100644 --- a/Net/POP3.pm +++ b/Net/POP3.pm @@ -13,7 +13,7 @@ use Net::Cmd; use Carp; use Net::Config; -$VERSION = "2.11"; # $Id: //depot/libnet/Net/POP3.pm#4 $ +$VERSION = "2.12"; # $Id: //depot/libnet/Net/POP3.pm#5 $ @ISA = qw(Net::Cmd IO::Socket::INET); @@ -212,7 +212,9 @@ sub list return $1 || undef; } - my $info = $me->read_until_dot; + my $info = $me->read_until_dot + or return undef; + my %hash = (); map { /(\d+)\D+(\d+)/; $hash{$1} = $2; } @$info; @@ -250,7 +252,8 @@ sub uidl } else { - my $ref = $me->read_until_dot; + my $ref = $me->read_until_dot + or return undef; my $ln; $uidl = {}; foreach $ln (@$ref) { |