in reply to (bbfu) (list not working) Re(3): net::pop3 usage
in thread net::pop3 usage

Thank you this is working very well :-)))) but I have another question please. Methods from Net:Pop3 returns as results true or false meaning that operation was succes or not. But how to do something like this

unless ( $mail_count = $pop->login( $username, $password ) ) {
return 0;
}

This return to $mail_count number of mails. If there is 0 mails in pop3 box procedure end. But I want terminate procedure if method login will not be succesful. How should I do this?

Please, if you know, help me. Litin

  • Comment on Re: (bbfu) (list not working) Re(3): net::pop3 usage

Replies are listed 'Best First'.
(tye)Re: net::pop3 usage
by tye (Sage) on Mar 12, 2001 at 20:06 UTC

    Did you read the Net::Pop3 documentation? It says:

    login ( [ USER , PASS ] )
    ...
    Returns the number of messages in the mailbox. However if there are no messages on the server the string `"0E0"' will be returned. This is will give a true value in a boolean context, but zero in a numeric context.

    If there was an error authenticating the user then *undef* will be returned.

    So that suggests that you shouldn't be having the problem you claim and that you can also use defined if you like.

            - tye (but my friends call me "Tye")