Gossamer Forum
Home : General : Perl Programming :

web server

Quote Reply
web server
Hi

Does any one know how to do something similar to this:
http://www.domainwatch.com/...gossamer-threads.com

Quote Reply
Re: web server In reply to
This is straight forward header parsing, something that LWP does very well, and easy to do. \\ponders// This is a very brief code snip that will produce the output:
Code:
use LWP::UserAgent;
use HTTP::Request;

$ua = new LWP::UserAgent;
$request = HTTP::Request->new(GET => 'http://localhost/');
$response = $ua->request($request);
print $response->headers_as_string();
The following is an example of what was outputted by the program when I ran it on my Win32 Apache server installed locally:
Code:
Connection: close
Date: Thu, 28 Jan 1999 14:15:28 GMT
Accept-Ranges: bytes
Server: Apache/1.3.3 (Win32)
Content-Length: 1673
Content-Type: text/html
ETag: "0-689-36657e36"
Last-Modified: Wed, 02 Dec 1998 17:51:50 GMT
Client-Date: Thu, 28 Jan 1999 14:15:28 GMT
Client-Peer: 127.0.0.1:80
Title: Test Page for Apache Installation on Web Site
I hope this is what you had in mind.


------------------
Fred Hirsch
Web Consultant & Programmer
Quote Reply
Re: web server In reply to
fhirsch thanks for a quick reply that is exactly what i needed.

thanks again.