in reply to How to check number of messages using Net::POP3?
Seems like the problem is that the server after getting the wrong password closes the connection and this way $pop gets undefined?
No, you forget to quit and close the connection, which should be done even if there is a login failure. If you do quit and close the connection, the error message will be gone :) (just move it outside the if-statement)
# print number of msg or complain about failed login if (defined $a[0]) { print "Messages: $a[0]\n"; } else { print "Login failed.\n"; } $pop->quit();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How to check number of messages using Net::POP3?
by BjoernD (Initiate) on Dec 23, 2003 at 22:18 UTC | |
by b10m (Vicar) on Dec 23, 2003 at 22:55 UTC | |
by BjoernD (Initiate) on Dec 23, 2003 at 23:24 UTC | |
|
Re: Re: How to check number of messages using Net::POP3?
by Roger (Parson) on Dec 23, 2003 at 22:55 UTC | |
by b10m (Vicar) on Dec 23, 2003 at 23:33 UTC | |
by Roger (Parson) on Dec 23, 2003 at 23:37 UTC | |
by b10m (Vicar) on Dec 24, 2003 at 00:18 UTC |