#!/usr/bin/perl -w use IO::Socket; unless (@ARGV) { die "usage: $0 URL\n" } $EOL = "\015\012"; $BLANK = $EOL x 2; $sep = (@ARGV > 1) ? "-------------------\n" : ""; foreach $url ( @ARGV ) { unless($url =~ m{^http://(.*?)/}) { print "$0: invalid url: $url\n"; next } $host = $1; $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => "http(80)", ); unless ($remote) { die "Cannot connect to http daemon on $host\n" } $remote->autoflush(1); print $remote "GET $url HTTP/1.0" . $BLANK; while ( <$remote> ) { print } print "\n$sep"; close $remote; } #### $ ./gethttp 'http://login.gatorlink.ufl.edu/authenticate.cgi' HTTP/1.0 404 Not Found Date: Fri, 12 Jan 2001 22:57:21 GMT Server: Apache/1.3.6 (Unix) mod_perl/1.19 mod_ssl/2.2.8 OpenSSL/0.9.2b Connection: close Content-Type: text/html 404 Not Found

Not Found

The requested URL http://login.gatorlink.ufl.edu/authenticate.cgi was not found on this server.