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'); #### 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 => 0rjco545pbrr3gbwmsi5ndjy LWP::UserAgent::request: Simple response: OK Can't locate object method "decoded_content" via package "HTTP::Headers" at (eval 16) line 1