in reply to Mail::POP3Client on Unix problem

$loginname = "user@example.com";
in this string @example is interpolated as array.
You can write 'user@example.com' or "user\@example.com"

Question about "500 Internal server error" is question No. 1 in many CGI FAQ's.
Read one of them or read this node: Why do I keep getting a 500 Internal server error?