New error message is Connection reset by peer at ./pcs.pl line 29.use Socket; use CGI; my $page = connect_host() or die "$!";; print "$page"; flush(SOCK); sub connect_host { my $remote = gethostbyname("football.fantasysports.yahoo.com") +; my $proto = getprotobyname('tcp'); my $port = 80; my $remote_host = sockaddr_in($port,$remote); socket(SOCK,PF_INET,SOCK_STREAM,$proto) or die "$!"; connect(SOCK, $remote_host); print SOCK "GET / HTTP/1.0\015\012\015\012"; my $html = <SOCK> if(defined(<SOCK>)) or die "$!"; return $html; } sub flush { select($_[0]); my $t=$|; $|=1; $|=$t; }
In reply to Re^5: Fetching HTML Pages with Sockets
by amt
in thread Fetching HTML Pages with Sockets
by amt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |