.
.
use AppConfig;
use File::Basename;
use Getopt::Long;
use HTML::Form;
use HTTP::Request::Common;
use HTML::TreeBuilder;
use LWP::DebugFile ('+');
use LWP::UserAgent;
use Pod::Usage;
use URI::file;
.
.
$ua = LWP::UserAgent->new();
$ua->agent('Mozilla/4.0');
$ua->max_size('5000');
.
.
$ua->credentials($netloc, $realm, $userid, $passwd);
.
.
$request = HTTP::Request->new(GET => "http://192.168.1.1/Status.htm");
$response = $ua->request($request);
#$response = $ua->request($request,"rspfile.html");
if ($response->is_error) {
my $string;
print "Error: " . $response->status_line . "\n";
print $response->error_as_HTML;
$string = $response->as_string;
die "$string\n";
}
.
.
----------------
FreeBSD/i386 (blah blah blah)
login: steve
Password:
Last login: Wed May 21 16:59:51 from 192.168.1.1
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 4.7-RELEASE (ACCESS) #0: Tue Feb 11 19:33:55 EST 2003
Welcome blah blah blah
steve> cd perlstuff
steve/perlstuff> ./LinkSys.pl
getting http://192.168.1.1/Status.htm...
Error: 500 Can't read entity body: Connection reset by peer
An Error Occurred
An Error Occurred
500 Can't read entity body: Connection reset by peer
500 (Internal Server Error) Can't read entity body: Connection reset by peer
Client-Date: Thu, 22 May 2003 12:43:11 GMT
-----------------
Log:-
# LWP::DebugFile logging to lwp_3eccc413_2a9d.log
# Time now: {1053606945} = Thu May 22 08:35:45 2003
# Time now: {1053606959} = Thu May 22 08:35:59 2003
LWP::UserAgent::new: ()
# Time now: {1053606960} = Thu May 22 08:36:00 2003
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.1.1/Status.htm
LWP::UserAgent::_need_proxy: Not proxied
# Time now: {1053606965} = Thu May 22 08:36:05 2003
LWP::Protocol::http::request: ()
# Time now: {1053606966} = Thu May 22 08:36:06 2003
LWP::Protocol::collect: read 340 bytes
LWP::UserAgent::request: Simple response: Unauthorized
# Time now: {1053606967} = Thu May 22 08:36:07 2003
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.1.1/Status.htm
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 903 bytes
LWP::Protocol::collect: read 3770 bytes
LWP::UserAgent::request: Simple response: Internal Server Error
ttyp0://access/home/steve/perlstuff>