# try to simulate wget: my $cookie_jar = HTTP::Cookies->new( file => "$cookie", autosave => 1, ); my $ua = LWP::UserAgent->new ; $ua->timeout(2); $ua->cookie_jar($cookie_jar); $ua->credentials ("$host:$port","Tomcat Manager Application",$user,$password); my $request= HTTP::Request->new (GET=> "http://$host:$port/manager/status?XML=true"); my $status=$ua->request ($request); if ($status->is_success) { $page=$status->decoded_content(); } else { print STDERR $status->status_line, "\n"; return 1; }