Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Mail::POP3Client on Unix problem

by DearHeart (Initiate)
on Jul 18, 2002 at 14:41 UTC ( [id://182826]=perlquestion: print w/replies, xml ) Need Help??

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

I have successfully run the following code on Windows but I get a "500 Internal server error" when I upload the file to a Unix server. I have determined that it is the "@" in $loginname that is causing the problem. How do I solve the problem? Thanx.
#!/usr/bin/perl use Mail::POP3Client; $loginname = "user@example.com"; $password = "password"; $POPserver = "pop.example.com"; $pop = new Mail::POP3Client($loginname, $password, $POPserver); $MessageCount = $pop->Count; print "Content-type: text/html\n\n"; if ($pop->Count == -1){ print "Connection Failed"; } else { print "Connected!"; }

Replies are listed 'Best First'.
Re: Mail::POP3Client on Unix problem
by rattusillegitimus (Friar) on Jul 18, 2002 at 14:48 UTC

    Escape the @ or use single rather than double quotes around the login name. I suspect you're getting unwanted variable interpolation there. I'd do:

    $loginname - 'user@example.com';
    __________
    He seemed like such a nice guy to his neighbors / Kept to himself and never bothered them with favors
    - Jefferson Airplane, "Assassin"

    Update: fixed my closing single-quote

      Thank you very much! I have been searching the archives for hours! Should've asked much sooner. Single quotes did the trick.
Re: Mail::POP3Client on Unix problem
by vagnerr (Prior) on Jul 18, 2002 at 14:49 UTC
    Should be just a simple matter of
    $loginname = "user\@example.com";


    ---If it doesn't fit use a bigger hammer
Re: Mail::POP3Client on Unix problem
by Anonymous Monk on Jul 18, 2002 at 15:01 UTC
    $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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://182826]
Approved by vagnerr
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-24 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found