Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

While playing with Net::POP i wrote a very small basic script that tells you if you have mail and how many, when i run it with an incorrect password i get Use of uninitialized value in numeric eq (==) at /usr/lib/perl5/site_perl/5.6.0/Net/POP3.pm line 287. It might just be me but i wouldn't expect it to start spitting out warnings, i'd expect it to die
#! /usr/bin/perl -w use strict; use Net::POP3; my $POPObj = Net::POP3->new("mail.myisp.net", Timeout => 10); my $Ret = $POPObj->login("AnonMonk", "BrokenPass"); if ($Ret) { if ($Ret eq "0E0") { print "You have no messages...\n"; } elsif ($Ret) { print "You have $Ret messages\n"; } } else { print "Something went wrong...\n"; } $POPObj->quit();

Views and maybe answers welcome.

Replies are listed 'Best First'.
Re: Net::POP and the uninitialized numeric
by Brovnik (Hermit) on Jun 12, 2001 at 18:50 UTC
    Works fine for me, I get the "Something went wrong..." message.

    Check the version you have, my Net::POP3 is v2.21 and perl 5.6.1.
    --
    Brovnik

      I have perl 5.6.0 and Net::POP3 2.21 and it shows up under warnings. I'll try and get access to a 5.6.1 box and try on that.