sub establishConnection{ my ($url) = @_; # create UserAgent my $agent = LWP::UserAgent->new(); # keep alive $agent->conn_cache(LWP::ConnCache->new()); # the newly created connection cache object will cache only one connection at time # To have it cache more, total_capacity attribute is used. # total_capacity(10) will cache 10 connection, undef with no limits $agent->conn_cache->total_capacity(undef); # user agent $agent->agent('Opera/9.80 (X11; Linux i686; U; en) Presto/2.2.15 Version/10.10'); # timeout $agent->timeout(); # cookies $agent->cookie_jar( {} ); # post request my $response = $agent->post($url, [ 'j_id_jsp_1095591257_1' => 'j_id_jsp_1095591257_1', 'j_id_jsp_1095591257_1:pflegeart' => '1000', 'j_id_jsp_1095591257_1:pLZ' => '55425' , 'j_id_jsp_1095591257_1:entfernung' => '20', 'j_id_jsp_1095591257_1:ort' => '', 'j_id_jsp_1095591257_1:j_id_jsp_1095591257_49' => 'Suche+starten', 'javax.faces.ViewState' => 'j_id10035:j_id10037', ] ); print $response->content(); }