elusion has asked for the wisdom of the Perl Monks concerning the following question:
The exact error I get when running the script is Can't call method "login" on an undefined value at mail.pl line 25, <STDIN> line 1. What's happening? P.S. I'm running Windows 98 IndigoPerl. Thanx for your help,my $pop3 = Net::POP3->new('$host'); ############################### PROMPT: while ($var == 2) { print '#! '; $current_input = <STDIN>; if($current_input =~ /^login/) { &login; } } ############################### sub login() { print "logging in...\n"; $pop3 = Net::POP3->new('$host'); LOGIN: if ($numb = $pop3->login("$username", "$password")) { #line + 25 system("cls"); print "logged in...\n"; print "you have $numb messages...\n"; } else { print $numb; print "couldn't login, try again?[y/n] "; my $answer = <STDIN>; if ($answer =~ /y/i) { goto LOGIN; } } goto PROMPT; }
- p u n k k i d
"Reality is merely an illusion, albeit a very persistant one"
-Albert Einstein
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Undef on POP3 method
by Russ (Deacon) on Jul 31, 2000 at 04:47 UTC | |
by elusion (Curate) on Jul 31, 2000 at 04:50 UTC | |
by young perlhopper (Scribe) on Jul 31, 2000 at 04:56 UTC | |
by Russ (Deacon) on Jul 31, 2000 at 04:54 UTC | |
by elusion (Curate) on Jul 31, 2000 at 05:05 UTC |