in reply to I Appear To Be HTTP-Stupid

1. Trying to use the snippet at Node 96037 gets me ...

First, have you verified that there's a Perl in /usr/local/bin/? Second, that snippet doesn't print a valid HTTP hesponse header. Adding

print "Content-type: text/html\r\n\r\n";
before you print $results should be sufficient.

Update: I misread the question. Looking at it again, the issue appears to be on the Earthlink side.

C:\> cd \perl\bin C:\Perl\bin> GET http://home.earthlink.net/ <HTML> <HEAD><TITLE>An Error Occurred</TITLE></HEAD> <BODY> <H1>An Error Occurred</H1> 404 Not Found </BODY> </HTML> C:\Perl\bin>
(GET is a batch file that uses LWP.)

Replies are listed 'Best First'.
Re: Re: I Appear To Be HTTP-Stupid
by marinersk (Priest) on Apr 15, 2003 at 22:07 UTC
    This is not being used in a CGI context. It is command line from a normal user system (I'm trying to learn LWP and HTTP handling basics via snippet theft).

    Am I using the wrong snippet for the job?

    Update: I did correct the perl location indicator, but this is ActiveState Perl on Windows 2000; the directory information is ignored in this environment. But I went ahead and corrected that and got no change in behavior.

    Update #2: I added the line you suggested, but since I'm just printing locally I didn't figure it would matter. Besides, the timeout error suggests I am having problems before I get to the print statements. Nonetheless I added it, and still there is no change in behavior.

Re: Re: I Appear To Be HTTP-Stupid
by marinersk (Priest) on Apr 15, 2003 at 22:34 UTC
    Need to add the /~marinersk/ portion of the URL. Just asking for http://home.earthlink.net/ should get a 404.