I think this bit of code used to work, but I can't figure how to make
the last line dump anything out...

,----- [  ]
| use strict;
| use warnings;
| use IO::Socket;
| 
| my $socket =->new("localhost:80")
|         or  die "cannot connect to localhost:80 : [EMAIL PROTECTED]";
| print $socket "GET / HTTP/1.1\n\n";
| 
| while (<$socket>) { print }
`-----

Can anyone point out what I am doing wrong? I think it has to do with
the while line, but I can't figure it out.

I can "telnet localhost 80" and if I send the "GET / HTTP/1.1" command
followed by 2 new-lines, the web server sends back the default
document as expected...

,----- [  ]
| HTTP/1.0 200 OK
| Date: Thu, 26 Jun 2003 02:31:40 GMT
| Server: TinyWeb/1.9
| Content-Length: 342
| Content-Type: text/html
| Last-Modified: Wed, 25 Jun 2003 23:06:00 GMT
| 
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
| <html>
|   <head>
|     <meta content="HTML Tidy, www.w3.org" name="generator">
|     <title></title>
|   </head>
|   <body>
|     Test 'root' document.
|   </body>
| </html>
| 
| 
| Connection to host lost.
`-----

Thanks!

-- 
Tim Musson
Flying with The Bat! eMail v1.62q
Windows 2000 5.0.2195 (Service Pack 2)
"Upgrade: take old bugs out, put new ones in."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to