Friends

I have an simple "Asante Cable/DSL Router" which gets its IP address from my ISP. I wanted to write a short script that uses WWW::Mechanize to login and scrape out what my IP address is. So here's the scripts I wrote (Removing my actual password of course) ...

#!/usr/bin/perl -w use strict; use WWW::Mechanize; use Data::Dumper; my $mech = WWW::Mechanize->new(); my $url = "http://192.168.123.254/begin.htm"; print "Getting $url ...\n"; $mech->get( $url ); print "Got!\n"; my $fields = { 'URL' => 'XXXXXXXX' }; #print Dumper ( $mech ); print "Submitting form ... \n"; my $r = $mech->submit_form( form_name => 'LOGIN', fields => $fields ); if ( $r->is_success ) { print "logged on!\n"; } else { print "Couldn't submit form:$!\n"; }
... when I run this I get ...
Couldn't submit form:Connection reset by peer
Anyone out there know why I might be getting this error and want I can do about it?

In reply to Get IP address from my Asante Cable/DSL router by Plankton

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.