in reply to Can't call method... works locally, but not on webserver.

It is generally better to check
if (! defined $res )
instead of
if ($res eq "undef")
if Net::POP3->new fails with an undef value.