WWWgrab.pm is a perl5 module to get various response information from an http URL on the World Wide Web for people who have not fully digested or need all the functions of the LWP or www-lib modules. It has functions to get just web page contents, contents with headers, just the HTTP headers or just the first line of the response as a string to validate the URL. The URL can contain a urlencoded query string to test CGI scripts that use the GET method. Examples of URL's: http://www.foo.com http://www.foo.com/bar/ http://www.foo.com/~bar/index.html http://www.foo.com/~bar/script.cgi?var1=true&var2=this+long+string If this module is not in the same directory of the script you need to include a line like the following which adds the path to this module to the beginning of the @INC list of search directories: use lib '/path_to_dir/this_module_is_in'; Then this line will tell your script to use subroutines in that module as functions: use WWWgrab; The functions you can use in your script from this module are: wwwgrab(URL) - Returns www page contents or script output without any headers. Useful for copying a page from the Web. wwwget(URL) - Returns HTTP response headers, a blank line, and then page contents or CGI script results. Useful for testing CGI scripts for proper response headers. wwwhead(URL) - Returns full HTTP response headers without page contents. Can tell you webserver version, last modified date and other information. wwwhttp(URL) - Returns string containing the first line of HTTP response. Useful for validating links. Sample response: "HTTP/1.1 200 OK" TODO I may include a routine to POST to CGI scripts as soon as I figure out the most useful configuration. I have a separate wwwpost.pl script available which can POST raw urlencoded data that has been saved to a file as one form per line. NOTE Modules do not need execute permission or a line to point to perl since perl will already be running and know what to do with it if properly called out in your main script. BUGS 10/18/97 Sprinkled liberally with local and my variable declarations to avoid old data during multiple calls. David Efflandt (efflandt@xnet.com) http://www.xnet.com/~efflandt/