I have installed the perl module WWW:Mechanize in my machine. The machine contains RHEL 4. And when i ran a program like the following one:
use strict; use WWW::Mechanize; use HTTP::Cookies; use HTTP::Request::Common; use HTTP::Response; use LWP::Debug qw(+); ####################### ####Variables $username, etc ######################## my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); # post login $mech->get($url); $mech->form_name('Form1'); $mech->field('txtUserID' => $username); $mech->field('txtPassword' => $password); #$mech->field('btnSubmit' => 'Submit'); my $response=$mech->click('btnSubmit');
I got the following error when i used the Debug mod for LWP.
LWP::UserAgent::new: () LWP::UserAgent::request: () LWP::UserAgent::send_request: GET https://www.abc.com/default.aspx LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 739 bytes LWP::Protocol::collect: read 4096 bytes LWP::Protocol::collect: read 4096 bytes LWP::Protocol::collect: read 4096 bytes LWP::Protocol::collect: read 2281 bytes HTTP::Cookies::extract_cookies: Set cookie ASP.NET_SessionId => 0rjco5 +45pbrr3gbwmsi5ndjy LWP::UserAgent::request: Simple response: OK Can't locate object method "decoded_content" via package "HTTP::Header +s" at (eval 16) line 1
But, When i removed the line decoded_content() from the Mechanize.pm module in my system, i got the correct response. Since it is not correct to modify the modules in CPAN for specific use, can you suggest me some ways of how to overcome this error or how i can rectify this?

In reply to Problem with the module WWW::Mechanize by gjwilson21

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.