#!/usr/bin/perl --
use strict;
use warnings;
use WWW::Mechanize;
my $ua = WWW::Mechanize->new;
$ua->get(qw! https://utdirect.utexas.edu/registrar/nrclav !);
print "\n\n",
$ua->response->status_line, " ", $ua->uri, "\n\n",
$ua->cookie_jar->as_string, "\n\n";
$ua->set_visible(qw' TESTusername TESTpassword');
print $ua->current_form->dump,"\n\n";
$ua->submit;
print "\n\n", $ua->response->request->as_string, "\n\n",
$ua->cookie_jar->as_string, "\n\n";
print "Error: $1 " if $ua->content =~ m{\Q\E(.+?)\Q\E}s;
__END__
200 OK https://utdirect.utexas.edu/registrar/nrclav/index.WBX
Set-Cookie3: DOC="/registrar/nrclav/index.WBX"; path="/"; domain=.utexas.edu; path_spec; discard; version=0
Set-Cookie3: FC=NONE; path="/"; domain=.utexas.edu; path_spec; discard; version=0
Set-Cookie3: PDLK=NONE; path="/"; domain=.utexas.edu; path_spec; discard; version=0
Set-Cookie3: SC=NONE; path="/"; domain=.utexas.edu; path_spec; discard; version=0
POST https://utdirect.utexas.edu/security-443/logon_check.logonform [logonform]
CDT=20090331212639 (hidden readonly)
NEW_PASSWORD= (hidden readonly)
CONFIRM_NEW_PASSWORD= (hidden readonly)
PASSWORDS= (hidden readonly)
LOGON=TESTusername (text)
PASSWORDS=TESTpassword (password)
=Log In (submit)
POST https://utdirect.utexas.edu/security-443/logon_check.logonform
Accept-Encoding: gzip
Referer: https://utdirect.utexas.edu/registrar/nrclav
User-Agent: WWW-Mechanize/1.54
Content-Length: 107
Content-Type: application/x-www-form-urlencoded
Cookie: SC=NONE; PDLK=NONE; FC=NONE; DOC=/registrar/nrclav/index.WBX
Cookie2: $Version="1"
CDT=20090331212639&NEW_PASSWORD=&CONFIRM_NEW_PASSWORD=&PASSWORDS=&LOGON=TESTusername&PASSWORDS=TESTpassword
Set-Cookie3: DOC="/registrar/nrclav/index.WBX"; path="/"; domain=.utexas.edu; path_spec; discard; version=0
Set-Cookie3: FC=NONE; path="/"; domain=.utexas.edu; path_spec; discard; version=0
Set-Cookie3: PDLK=NONE; path="/"; domain=.utexas.edu; path_spec; discard; version=0
Set-Cookie3: SC=NONE; path="/"; domain=.utexas.edu; path_spec; discard; version=0
Set-Cookie3: TS=20090331212639; path="/"; domain=.utexas.edu; path_spec; discard; version=0
Error:
An error has occurred. You are not at fault. This error has automatically been reported to the System Administrator. Please try again later.