Re: Help getting output from IO::Socket::INET

2003-06-26 Thread Tim Musson
Errr, sorry, I cut the "IO::Socket::INET" to put it in the subject, I
should have done a copy...

Here is what it should have been...


use IO::Socket;

my $socket = IO::Socket::INET->new("localhost:80")
or  die "cannot connect to localhost:80 : [EMAIL PROTECTED]";
print $socket "GET / HTTP/1.1\n\n";

while (<$socket>) { print }   # My Problem line...


Thanks for any help!

-- 
Tim Musson
Flying with The Bat! eMail v1.62q
Windows 2000 5.0.2195 (Service Pack 2)
Ever stop to think, and forget to start again?


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



Help getting output from IO::Socket::INET

2003-06-25 Thread Tim Musson
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
| 
| 
| 
|   
| 
| 
|   
|   
| Test 'root' document.
|   
| 
| 
| 
| 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]