use HTML::Entities; # encode and decode things like <, >, and &
use HTML::Form; # for form processing
use HTTP::Cookies; # keep track of cookie
use HTTP::Request::Common;
use LWP::UserAgent; # pretend we are a browser
use Data::Dumper;
use Exporter;
use LWP::Debug qw(+);
use strict;
my $url = 'https://interddt.com/cqweb/logon/default_content.asp';
my $browser = LWP::UserAgent->new;
my $response = $browser->request(POST "$url", [ DatabaseName => 'TECH', User => '', Password => '' ]);
die "Error at $url\n ", $response->status_line, "\n Aborting"
unless $response->is_success;
print "Whee, it worked! I got that ",
$response->content_type, " document!\n";
####
#> perl ./test.pl
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::simple_request: POST https://dtinterddt.digitalthink.com/cqweb/logon/default_content.asp
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::http::request: POST /cqweb/logon/default_content.asp HTTP/1.0
Host: dtinterddt.digitalthink.com
User-Agent: libwww-perl/5.53
Content-Length: 48
Content-Type: application/x-www-form-urlencoded
LWP::Protocol::http::request: POST /cqweb/logon/default_content.asp HTTP/1.0
Host: dtinterddt.digitalthink.com
User-Agent: libwww-perl/5.53
Content-Length: 48
Content-Type: application/x-www-form-urlencoded
LWP::Protocol::http::request: reading response
LWP::Protocol::http::request: HTTP/1.1 302 Object moved
Server: Microsoft-IIS/5.0
Date: Mon, 06 Dec 2004 10:58:27 GMT
Location: /cqweb/default_content.asp
Connection: Keep-Alive
Content-Length: 121
Content-Type: text/html
Set-Cookie: CQWebUsrSettings=LOGON%5FUSER=dkhanna&LOGON%5FDBSET=2002%252e05%252e00&LOGON%5FDB=TECH; expires=Mon, 27-Dec-2004 08:00:00 GMT; path=/
LWP::Protocol::http::request: HTTP/1.1 302 Object moved
LWP::Protocol::http::request: need more header data
LWP::Protocol::collect: read 21 bytes
LWP::Protocol::collect: read 100 bytes
LWP::UserAgent::request: Simple response: Found
Error at https://dtinterddt.digitalthink.com/cqweb/logon/default_content.asp
302 Object moved
Aborting at ./test.pl line 16