use LWP::UserAgent; use HTTP::Request; use HTTP::Cookies; my $url = shift || 'http://192.168.2.10/data/ajax.txt?CAN=1&HASH=00100403&TYPE=1'; # setup your browser my $ua = LWP::UserAgent->new(keep_alive => 1, timeout => 300); # what kind of browser you are $ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5"); # a place to store cookies, if needed $ua->cookie_jar( HTTP::Cookies->new(file => "perlcookies.dat", autosave => 1) ); # now build a request my $request = HTTP::Request->new( GET => $url ); # set credentials $request->authorization_basic('BN','PW'); # run browser my $response = $ua->request($request); # and check response printf $response->content();