my $HOST = 'http://webserver_address'; my $DESTINATION = '/rel_path/nt/GetStats.asp' print "Enter Username: "; chop( $c0 = ); print "\n"; system "stty -echo"; print "Enter Password: "; chop( $c1 = ); print "\n"; system "stty echo"; package MyAgent; use base 'LWP::UserAgent'; sub get_basic_credentials { return "$c0", "$c1"; } package main; my $agent = MyAgent->new; push @{ $agent->requests_redirectable }, 'POST'; $agent->cookie_jar( HTTP::Cookies->new() ); my $response = $agent->get( "$HOST" ); print $response->code; #check after the initial login success if ( $response->is_success ) { print "\nGot OK\n"; print "Reading Excel...\n"; $response = $agent->request( POST $HOST . $DESTINATION, [ Prod => '8345', User => "$c0", Code => "ONET", URL => "http://anotherurl/getdata?action=live_report&ID=3", ] ); if ( $response->is_success ) { $tmp = $response->content; } else { die "Request failed, got status [" . $response->status_line . "]\n"; } }