sub HTTP_Request { (undef, $timeout, $url) = @_; $http = new HTTP::Lite; $st = time(); until ((time()-$st > $timeout) || ($req = $http->request($search))) { sleep(.1); } if ($req ne "200") { if ($req eq "") { return "Error: Timeout"; } else { return "Error: $http->status_message(); } } else { return $http->body(); } }