in reply to Retrieve a CGI page

This is a chunk I bodged together a while ago which might help. It gets the page generated by the url in $location and saves it on my local machine in $file. Please be warned that I don't really know what IO::Socket does, so your mileage may vary (or even the wheels may fall off).
use IO::Socket; use URI; my $url = new URI( $location ); my $host = $url->host; my $port = $url->port || 80; my $path = $url->path || "/"; my $query = $url->query; $path .= '?' . $query; my $socket = new IO::Socket::INET (PeerAddr => $host, PeerPort => $por +t, Proto => 'tcp') or die "cannot connect\n"; $socket->autoflush (1); print $socket "GET $path HTTP/1.1\n", "Host: $host\n\n"; open (SAVE, ">$file"); print SAVE while (<$socket>); $socket->close; close SAVE;


§ George Sherston