First, you should probably edit your code to remove the username and pass (unless this is an account set up specifically for testing this script).
It seems to me that you should move your initialization of your pop object to outside the until loop:
use Mail::POP3Client;
$pop = new Mail::POP3Client(
USER => "username",
PASSWORD => "password",
HOST => "server.domain.tld",
AUTH_MODE => "PASS",
DEBUG => 1
);
$MailState = $pop->State;
if ( $MailState eq 'AUTHORIZATION' ) {
die "\n\nBad user name or password!\n";
}
elsif ( $MailState eq 'DEAD' ) {
die "\n\nMail server unreachable or unavailable!\n";
}
$continue = "false";
until ( $continue = "true" ) {
...
This won't get your whole script working, but with this change it does connect and check my messages.
Hope this helps...