A poor workman blames his tools.
#!/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<span class="error">\E(.+?)\ +Q</span>\E}s; __END__ 200 OK https://utdirect.utexas.edu/registrar/nrclav/index.WBX Set-Cookie3: DOC="/registrar/nrclav/index.WBX"; path="/"; domain=.utex +as.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; disca +rd; 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 [l +ogonform] CDT=20090331212639 (hidden readonly) NEW_PASSWORD= (hidden readonly) CONFIRM_NEW_PASSWORD= (hidden readonly) PASSWORDS= (hidden readonly) LOGON=TESTusername (text) PASSWORDS=TESTpassword (password) <NONAME>=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=&LOGO +N=TESTusername&PASSWORDS=TESTpassword Set-Cookie3: DOC="/registrar/nrclav/index.WBX"; path="/"; domain=.utex +as.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; disca +rd; version=0 Set-Cookie3: SC=NONE; path="/"; domain=.utexas.edu; path_spec; discard +; version=0 Set-Cookie3: TS=20090331212639; path="/"; domain=.utexas.edu; path_spe +c; 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 a +gain later.

In reply to Re: WWW:Mechanize and Cookies by Anonymous Monk
in thread WWW:Mechanize and Cookies by uni_j

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.