I am trying to use the perl cookbook to write a script to process POP mail (Recipe 18.5) and getting a compile error. The problem code is:
The error I'm getting on the second statement is : Global symbol "$pop" requires explicit package name ...
Why does it think $pop is global when I've already declared it as local? Is the cookbook wrong or am I missing something basic that the cookbook assumes? TIA.
Code:
use strict:
use Net::POP3;
my $pop=Net::POP3->new("mail.mydomain.com")
or die "Mail server not responding: ",$!,"\n";
defined ($pop->login("username","password"))
or die "Login failed: ",$!,"\n";
Why does it think $pop is global when I've already declared it as local? Is the cookbook wrong or am I missing something basic that the cookbook assumes? TIA.