View Single Post
Old 09-07-2004, 10:39 PM   #1 (permalink)
gty
Registered User
 
Join Date: Sep 2004
Posts: 2
gty is on a distinguished road
{perl} HTTP Error Code Response

I need to be able to send http requests to a given server and have it respond with the error code of the page displayed. Something with a response like:

C:\> perl blah.pl host.com 80
Error Code: 404 (Page Not Found)

or

C:\> perl blah.pl host2.com 80
Error Code: 403 (Forbidden)

So I looked up info on the HTTP::Request class and tried

Code:
require HTTP::Request;

$request = HTTP::Request->new(GET => 'http://www.host.com');

print $request;
but was responded with
Code:
HTTP::Request=HASH(0x1899864)
I'm a newbie when it comes to Perl but any ideas would be greatly appreciated.
gty is offline   Reply With Quote