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.