use Socket; sub post { local($res); eval { local $SIG{ALRM} = sub { die "alarm\n" }; alarm(10); # Timeout - 10 Sekunden $url = shift; $content = shift; $referer = shift; $content_type = shift || "application/x-www-form-urlencoded"; $content_length = length($content); ($host, $uri) = ($url =~ m!http://(.*?)(/.*)!); socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp'); connect SOCK, sockaddr_in(80, inet_aton($host)); send SOCK, "POST $uri HTTP/1.0\r\nHost: $host\r\n" . "Content-Type: $content_type\r\nContent-Length:" . "$content_length\r\n\r\n$content", 0; 0 while !~ /^\r\n$/; $res .= $_ while ; close SOCK; alarm(0); }; return($res); }