Subject: | Uidl() broken |
The behavior of Uidl() in scalar context and with a message number
argument does not match its documentation. In both cases it returns the
actual text returned, for which I cannot think of any use. Even if
there were, there ought to be a way to get the UIDL of a particular
message, and there isn't, except by getting them all:
$uidl = ($pop->Uidl)[$i];
instead of
($uidl) = $pop->Uidl($i);
Maybe someone wants the scalar context behavior for something, but the
second line of code above should work. In which case change
if ($num) {
$line =~ s/^\+OK\s*//;
return $line;
}
to (untested):
if ($num) {
$line =~ s/^\+OK\s*//;
(undef, my $uidl) = split /\s+/, $line;
return wantarray ? ($uidl) : $line;
}