use Net::POP3; my $pop = Net::POP3->new("webmail2.sonicwall.com"); my $numInboxMsgs = $pop->login('sdevassy', 'xxxxxx'); unless ($numInboxMsgs) { print "Could not login to pop3 mailbox."; exit 1; } if ($numInboxMsgs eq '0E0') { $numInboxMsgs = 0; } print "Found $numInboxMsgs messages in the Inbox.";